Commit 3d1dc84d authored by Robert Bradshaw's avatar Robert Bradshaw

Conditionaly create int conversion functions.

parent 62e59ef4
...@@ -1375,19 +1375,21 @@ class CIntType(CNumericType): ...@@ -1375,19 +1375,21 @@ class CIntType(CNumericType):
exception_value = -1 exception_value = -1
def create_to_py_utility_code(self, env): def create_to_py_utility_code(self, env):
self.to_py_function = "__Pyx_PyInt_to_py_" + self.specialization_name() if type(self).to_py_function is None:
env.use_utility_code(TempitaUtilityCode.load( self.to_py_function = "__Pyx_PyInt_to_py_" + self.specialization_name()
"CIntToPy", "TypeConversion.c", env.use_utility_code(TempitaUtilityCode.load(
context={"TYPE": self.declaration_code(''), "CIntToPy", "TypeConversion.c",
"TO_PY_FUNCTION": self.to_py_function})) context={"TYPE": self.declaration_code(''),
"TO_PY_FUNCTION": self.to_py_function}))
return True return True
def create_from_py_utility_code(self, env): def create_from_py_utility_code(self, env):
self.from_py_function = "__Pyx_PyInt_from_py_" + self.specialization_name() if type(self).from_py_function is None:
env.use_utility_code(TempitaUtilityCode.load( self.from_py_function = "__Pyx_PyInt_from_py_" + self.specialization_name()
"CIntFromPy", "TypeConversion.c", env.use_utility_code(TempitaUtilityCode.load(
context={"TYPE": self.declaration_code(''), "CIntFromPy", "TypeConversion.c",
"FROM_PY_FUNCTION": self.from_py_function})) context={"TYPE": self.declaration_code(''),
"FROM_PY_FUNCTION": self.from_py_function}))
return True return True
def get_to_py_type_conversion(self): def get_to_py_type_conversion(self):
......
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