Commit c050817d authored by Stefan Behnel's avatar Stefan Behnel

fixes after last commit

parent 9e0f30c1
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Pyrex - Types # Pyrex - Types
# #
from Cython.Utils import UtilityCode
import StringEncoding import StringEncoding
import Naming import Naming
import copy import copy
...@@ -982,7 +983,7 @@ class CStructOrUnionType(CType): ...@@ -982,7 +983,7 @@ class CStructOrUnionType(CType):
entry = env.lookup(self.name) entry = env.lookup(self.name)
if entry.visibility != 'extern': if entry.visibility != 'extern':
proto = self.declaration_code('') + ';\n' + proto 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) env.use_utility_code(self._convert_code)
return True return True
......
...@@ -766,7 +766,7 @@ class ModuleScope(Scope): ...@@ -766,7 +766,7 @@ class ModuleScope(Scope):
# doc string Module doc string # doc string Module doc string
# doc_cname string C name of module doc string # doc_cname string C name of module doc string
# const_counter integer Counter for naming constants (PS: MOVED TO GLOBAL) # 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 # default_entries [Entry] Function argument default entries
# python_include_files [string] Standard Python headers to be included # python_include_files [string] Standard Python headers to be included
# include_files [string] Other C headers to be included # include_files [string] Other C headers to be included
...@@ -1512,11 +1512,12 @@ class PropertyScope(Scope): ...@@ -1512,11 +1512,12 @@ class PropertyScope(Scope):
# Should this go elsewhere (and then get imported)? # Should this go elsewhere (and then get imported)?
#------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------
classmethod_utility_code = [ classmethod_utility_code = Utils.UtilityCode(
""" proto = """
#include "descrobject.h" #include "descrobject.h"
static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/ static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
""",""" """,
impl = """
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
/* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */ /* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */
/* if (!PyObject_TypeCheck(method, &PyMethodDescr_Type)) { */ /* if (!PyObject_TypeCheck(method, &PyMethodDescr_Type)) { */
...@@ -1533,5 +1534,4 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { ...@@ -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."); PyErr_Format(PyExc_TypeError, "Class-level classmethod() can only be called on a method_descriptor or instance method.");
return NULL; return NULL;
} }
""" """)
]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment