Mark _init as global in pyafs_error
authorAlex Dehnert <adehnert@mit.edu>
Fri, 16 Dec 2011 14:19:51 +0000 (09:19 -0500)
committerAlex Dehnert <adehnert@mit.edu>
Fri, 16 Dec 2011 20:16:41 +0000 (15:16 -0500)
Because _init is later assigned to in the function, new enough versions of
cython (67bf84357feabe73612e2a9eef3e48a05e74d76f or so and later, apparently)
conclude that it's a local. Unfortunately, that means that the "if _init" is
referencing an undeclared variable. See also
http://codespeak.net/pipermail/cython-dev/2009-July/006396.html.

Signed-off-by: Alex Dehnert <adehnert@mit.edu>

afs/_util.pyx

index f7f167b..932bdf0 100644 (file)
@@ -54,6 +54,7 @@ class AFSException(Exception):
         return "[%s] %s" % (self.errno, self.strerror)
 
 def pyafs_error(code):
+    global _init
     if not _init:
         initialize_ACFG_error_table()
         initialize_KTC_error_table()