File: python3-PyUnicode_EncodeRawUnicodeEscape-fix-1042977

package info (click to toggle)
crossfire 1.75.0-8.1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,168 kB
  • sloc: ansic: 83,169; sh: 4,659; perl: 1,736; lex: 1,443; makefile: 1,198; python: 43
file content (16 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- a/plugins/cfpython/cjson.c
+++ b/plugins/cfpython/cjson.c
@@ -1260,13 +1260,7 @@
         return NULL;
 
     if (PyUnicode_Check(string)) {
-#ifdef IS_PY3K
-        /* HACK: Workaround for crash bug in Python3's PyUnicode_AsRawUnicodeEscapeString... */
-        str = PyUnicode_EncodeRawUnicodeEscape(PyUnicode_AS_UNICODE(string),
-                                               PyUnicode_GET_SIZE(string));
-#else
         str = PyUnicode_AsRawUnicodeEscapeString(string);
-#endif
         if (str == NULL) {
             return NULL;
         }