diff options
author | shadchin <shadchin@yandex-team.com> | 2024-04-11 21:35:50 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2024-04-11 21:45:16 +0300 |
commit | 00ff372db04018582b653a028eb3647b40544256 (patch) | |
tree | 77a826d8773ce993032736f6ba0a56f9629cc2b2 /contrib/tools/cython/Cython/Compiler | |
parent | e777f6fe503bff0abc88aec2b1f7da675bfb68ae (diff) | |
download | ydb-00ff372db04018582b653a028eb3647b40544256.tar.gz |
Fix utilitycode generation for const fused typedef (backport)
Need for update scikit-learn
371604d3522a7676f7380c48b63025dbe6dcf25f
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler')
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/FusedNode.py | 8 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/Naming.py | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/FusedNode.py b/contrib/tools/cython/Cython/Compiler/FusedNode.py index c32b02d941..b833e35189 100644 --- a/contrib/tools/cython/Cython/Compiler/FusedNode.py +++ b/contrib/tools/cython/Cython/Compiler/FusedNode.py @@ -3,7 +3,8 @@ from __future__ import absolute_import import copy from . import (ExprNodes, PyrexTypes, MemoryView, - ParseTreeTransforms, StringEncoding, Errors) + ParseTreeTransforms, StringEncoding, Errors, + Naming) from .ExprNodes import CloneNode, ProxyNode, TupleNode from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode from ..Utils import OrderedSet @@ -291,9 +292,10 @@ class FusedCFuncDefNode(StatListNode): """) def _dtype_name(self, dtype): + name = str(dtype).replace('_', '__').replace(' ', '_') if dtype.is_typedef: - return '___pyx_%s' % dtype - return str(dtype).replace(' ', '_') + name = Naming.fused_dtype_prefix + name + return name def _dtype_type(self, dtype): if dtype.is_typedef: diff --git a/contrib/tools/cython/Cython/Compiler/Naming.py b/contrib/tools/cython/Cython/Compiler/Naming.py index 4dd6cbbd5c..ceaddf4b18 100644 --- a/contrib/tools/cython/Cython/Compiler/Naming.py +++ b/contrib/tools/cython/Cython/Compiler/Naming.py @@ -118,6 +118,7 @@ frame_cname = pyrex_prefix + "frame" frame_code_cname = pyrex_prefix + "frame_code" binding_cfunc = pyrex_prefix + "binding_PyCFunctionType" fused_func_prefix = pyrex_prefix + 'fuse_' +fused_dtype_prefix = pyrex_prefix + 'fused_dtype_' quick_temp_cname = pyrex_prefix + "temp" # temp variable for quick'n'dirty temping tp_dict_version_temp = pyrex_prefix + "tp_dict_version" obj_dict_version_temp = pyrex_prefix + "obj_dict_version" |