From: William Stein Date: Thu, 30 Nov 2006 19:57:57 +0000 (-0800) Subject: Eric Huss's readonly variable patch: X-Git-Tag: 0.9.6.14~29^2~206 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f4961542b2e0502e0dac7e1a5065b6d4c943f9ea;p=cython.git Eric Huss's readonly variable patch: There's a minor bug, if you try to cdef a readonly variable at the module scope, the compiler raises an UnboundLocalError exception. The attached patch seems to clear up the problem and gets the compiler to report the correct error. --- diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index 062efb6a..08f186cc 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -183,6 +183,8 @@ class CCodeWriter: storage_class = "static" else: storage_class = "" + else: + storage_class = "" if storage_class: self.put("%s " % storage_class) #if visibility == 'extern' or visibility == 'public' and not definition: