fixes after last commit
authorStefan Behnel <scoder@users.berlios.de>
Sat, 25 Oct 2008 12:44:10 +0000 (14:44 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 25 Oct 2008 12:44:10 +0000 (14:44 +0200)
Cython/Compiler/PyrexTypes.py
Cython/Compiler/Symtab.py

index 9e4a3c2020f7e288e791b478815ef2e7ec728008..d0b9ab5c8e73642593334d653880aae702d8cbf0 100644 (file)
@@ -2,6 +2,7 @@
 #   Pyrex - Types
 #
 
+from Cython.Utils import UtilityCode
 import StringEncoding
 import Naming
 import copy
@@ -982,7 +983,7 @@ class CStructOrUnionType(CType):
             entry = env.lookup(self.name)
             if entry.visibility != 'extern':
                 proto = self.declaration_code('') + ';\n' + proto
-            self._convert_code = proto, code.buffer.getvalue()
+            self._convert_code = UtilityCode(proto=proto, impl=code.buffer.getvalue())
         
         env.use_utility_code(self._convert_code)
         return True
index 6700807ecc33ae17a95798ded48d5ebc6fb73563..a7f585600fb09b56bad2a36766b115517785185a 100644 (file)
@@ -766,7 +766,7 @@ class ModuleScope(Scope):
     # doc                  string             Module doc string
     # doc_cname            string             C name of module doc string
     # const_counter        integer            Counter for naming constants (PS: MOVED TO GLOBAL)
-    # utility_code_list    [((string, string), string)] Queuing utility codes for forwarding to Code.py
+    # utility_code_list    [(UtilityCode, string)] Queuing utility codes for forwarding to Code.py
     # default_entries      [Entry]            Function argument default entries
     # python_include_files [string]           Standard  Python headers to be included
     # include_files        [string]           Other C headers to be included
@@ -1512,11 +1512,12 @@ class PropertyScope(Scope):
 # Should this go elsewhere (and then get imported)?
 #------------------------------------------------------------------------------------
 
-classmethod_utility_code = [
-"""
+classmethod_utility_code = Utils.UtilityCode(
+proto = """
 #include "descrobject.h"
 static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
-""","""
+""",
+impl = """
 static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
     /* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */
     /* if (!PyObject_TypeCheck(method, &PyMethodDescr_Type)) { */ 
@@ -1533,5 +1534,4 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
     PyErr_Format(PyExc_TypeError, "Class-level classmethod() can only be called on a method_descriptor or instance method.");
     return NULL;
 }
-"""
-]
+""")