From cb5166acc1530cecad43c7d7f7cb6e5261af9a63 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 2 Aug 2008 21:53:04 -0700 Subject: [PATCH] Minor fixes, all tests pass I don't know how long_literal used to work, must have ran tests before that refactor... --- Cython/Compiler/Symtab.py | 2 +- Cython/Utils.py | 6 ++++-- tests/compile/extimportedsubtype.pyx | 2 +- tests/run/pylistsubtype.pyx | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 476f3164..69b12d79 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -401,7 +401,7 @@ class Scope: if entry and not entry.type.is_cfunction: # This is legal Python, but for now will produce invalid C. error(pos, "'%s' already declared" % name) - entry = self.declare_var(name, py_object_type, pos) + entry = self.declare_var(name, py_object_type, pos, visibility='extern') entry.signature = pyfunction_signature self.pyfunc_entries.append(entry) return entry diff --git a/Cython/Utils.py b/Cython/Utils.py index cb59d2f8..5a23b58e 100644 --- a/Cython/Utils.py +++ b/Cython/Utils.py @@ -121,7 +121,9 @@ def long_literal(value): if len(value) < 2: value = int(value) elif value[0] == 0: - return int(value, 8) + value = int(value, 8) elif value[1] in 'xX': - return int(value[2:], 16) + value = int(value[2:], 16) + else: + value = int(value) return not -2**31 <= value < 2**31 diff --git a/tests/compile/extimportedsubtype.pyx b/tests/compile/extimportedsubtype.pyx index dd081e0c..c1fb7514 100644 --- a/tests/compile/extimportedsubtype.pyx +++ b/tests/compile/extimportedsubtype.pyx @@ -4,4 +4,4 @@ cdef class Sub2(Crunchy): cdef char character cdef class Sub1(Sub2): - cdef char character + pass diff --git a/tests/run/pylistsubtype.pyx b/tests/run/pylistsubtype.pyx index 350f9d40..9911f048 100644 --- a/tests/run/pylistsubtype.pyx +++ b/tests/run/pylistsubtype.pyx @@ -29,4 +29,4 @@ cdef class Sub2(list): cdef char character cdef class Sub1(Sub2): - cdef char character + pass -- 2.26.2