From 7cd7d23d1f02b9620a45e5789a89cd68ce015d48 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 10 May 2008 14:50:09 +0200 Subject: [PATCH] unicode fixes --- Cython/Compiler/Nodes.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 4625e41c..4ca448f4 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -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; -- 2.26.2