From f4961542b2e0502e0dac7e1a5065b6d4c943f9ea Mon Sep 17 00:00:00 2001 From: William Stein Date: Thu, 30 Nov 2006 11:57:57 -0800 Subject: [PATCH] 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. --- Cython/Compiler/Code.py | 2 ++ 1 file changed, 2 insertions(+) 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: -- 2.26.2