unicode fixes
authorStefan Behnel <scoder@users.berlios.de>
Sat, 10 May 2008 12:50:09 +0000 (14:50 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 10 May 2008 12:50:09 +0000 (14:50 +0200)
Cython/Compiler/Nodes.py

index 4625e41cd3c1c40acbb058235285f9ce92b90c33..4ca448f454d7d27e80309061bc3c239e40348a6c 100644 (file)
@@ -4312,11 +4312,7 @@ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
 ""","""
 static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
     while (t->p) {
-        #if PY_MAJOR_VERSION < 3
         *t->p = PyString_InternFromString(t->s);
-        #else
-        *t->p = PyUnicode_InternFromString(t->s);
-        #endif
         if (!*t->p)
             return -1;
         ++t;
@@ -4334,13 +4330,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         if (t->is_unicode) {
-            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
-        } else {
             #if PY_MAJOR_VERSION < 3
-            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
             #else
             *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
             #endif
+        } else {
+            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
         if (!*t->p)
             return -1;