Skip to content

Instantly share code, notes, and snippets.

@robertwb
Created August 16, 2016 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertwb/5ef2075bc55aee7e705659ba63cd9c48 to your computer and use it in GitHub Desktop.
Save robertwb/5ef2075bc55aee7e705659ba63cd9c48 to your computer and use it in GitHub Desktop.
Attachment defined.patch for http://trac.cython.org/ticket/27
diff -ruw Cython-0.9.8.orig/Cython/Compiler/Scanning.py Cython-0.9.8/Cython/Compiler/Scanning.py
--- Cython-0.9.8.orig/Cython/Compiler/Scanning.py 2008-06-11 14:25:34.000000000 -0400
+++ Cython-0.9.8/Cython/Compiler/Scanning.py 2008-07-17 16:39:27.691882798 -0400
@@ -186,6 +186,9 @@
else:
raise
+ def defined(self, name):
+ return name in self.entries
+
def initial_compile_time_env():
benv = CompileTimeScope()
names = ('UNAME_SYSNAME', 'UNAME_NODENAME', 'UNAME_RELEASE',
@@ -201,6 +204,7 @@
for name in names:
benv.declare(name, getattr(__builtin__, name))
denv = CompileTimeScope(benv)
+ denv.declare('DEFINED', denv.defined)
return denv
#------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment