pr5233-backport-support-const.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. https://github.com/cython/cython/pull/5233
  2. --- contrib/tools/cython/Cython/Compiler/FusedNode.py (index)
  3. +++ contrib/tools/cython/Cython/Compiler/FusedNode.py (working tree)
  4. @@ -3,7 +3,8 @@ from __future__ import absolute_import
  5. import copy
  6. from . import (ExprNodes, PyrexTypes, MemoryView,
  7. - ParseTreeTransforms, StringEncoding, Errors)
  8. + ParseTreeTransforms, StringEncoding, Errors,
  9. + Naming)
  10. from .ExprNodes import CloneNode, ProxyNode, TupleNode
  11. from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode
  12. from ..Utils import OrderedSet
  13. @@ -291,9 +292,10 @@ class FusedCFuncDefNode(StatListNode):
  14. """)
  15. def _dtype_name(self, dtype):
  16. + name = str(dtype).replace('_', '__').replace(' ', '_')
  17. if dtype.is_typedef:
  18. - return '___pyx_%s' % dtype
  19. - return str(dtype).replace(' ', '_')
  20. + name = Naming.fused_dtype_prefix + name
  21. + return name
  22. def _dtype_type(self, dtype):
  23. if dtype.is_typedef:
  24. --- contrib/tools/cython/Cython/Compiler/Naming.py (index)
  25. +++ contrib/tools/cython/Cython/Compiler/Naming.py (working tree)
  26. @@ -118,6 +118,7 @@ frame_cname = pyrex_prefix + "frame"
  27. frame_code_cname = pyrex_prefix + "frame_code"
  28. binding_cfunc = pyrex_prefix + "binding_PyCFunctionType"
  29. fused_func_prefix = pyrex_prefix + 'fuse_'
  30. +fused_dtype_prefix = pyrex_prefix + 'fused_dtype_'
  31. quick_temp_cname = pyrex_prefix + "temp" # temp variable for quick'n'dirty temping
  32. tp_dict_version_temp = pyrex_prefix + "tp_dict_version"
  33. obj_dict_version_temp = pyrex_prefix + "obj_dict_version"