change usage of global variable '__pyx_modulename' in favor of a macro '__Pyx_MODULE_...
authorLisandro Dalcin <dalcinl@gmail.com>
Fri, 17 Apr 2009 16:46:07 +0000 (13:46 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Fri, 17 Apr 2009 16:46:07 +0000 (13:46 -0300)
Cython/Compiler/ExprNodes.py
Cython/Compiler/ModuleNode.py

index 732d5be891f6e28852a36d0804af400e8c89eb69..3bca440a21114defff541343942b3264ee059cc5 100644 (file)
@@ -5775,12 +5775,11 @@ static int __Pyx_cdivision_warning(void) {
                               "division with oppositely signed operands, C and Python semantics differ",
                               %(FILENAME)s, 
                               %(LINENO)s,
-                              %(MODULENAME)s,
+                              __Pyx_MODULE_NAME,
                               NULL);
 }
 """ % {
     'FILENAME': Naming.filename_cname,
-    'MODULENAME': Naming.modulename_cname,
     'LINENO':  Naming.lineno_cname,
 })
 
index 7c74484a9d8c8be0c2f631e1bb91e021c6e2adad..5b45ecc37b6bd1386c1241f60fcf710a58e03bc3 100644 (file)
@@ -253,7 +253,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
 
         code.globalstate.use_utility_code(refcount_utility_code)
 
-        code.putln('static const char *%s = "%s";' % (Naming.modulename_cname, self.full_module_name))
+        code.putln('#define __Pyx_MODULE_NAME "%s"' % self.full_module_name)
         code.putln("")
         code.putln("/* Implementation of %s */" % env.qualified_name)
         self.generate_const_definitions(env, code)