Commit 8d3d6952 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2317 from klaussfreire/fix_purepython_builtin_type_strings

Fix purepython builtin type strings
parents 645e717e 1cc7b13d
...@@ -40,6 +40,9 @@ Bugs fixed ...@@ -40,6 +40,9 @@ Bugs fixed
Note that this can have a performance impact on calls from Cython code. Note that this can have a performance impact on calls from Cython code.
(Github issue #1771) (Github issue #1771)
* Fix declarations of builtin or C types using strings in pure python mode.
(Github issue #2046)
Other changes Other changes
------------- -------------
......
...@@ -1377,7 +1377,13 @@ def _analyse_name_as_type(name, pos, env): ...@@ -1377,7 +1377,13 @@ def _analyse_name_as_type(name, pos, env):
return type return type
global_entry = env.global_scope().lookup_here(name) global_entry = env.global_scope().lookup_here(name)
if global_entry and global_entry.type and global_entry.type.is_extension_type: if global_entry is None:
global_entry = env.builtin_scope().lookup_here(name)
if global_entry and global_entry.type and (
global_entry.type.is_extension_type
or global_entry.type.is_struct_or_union
or global_entry.type.is_builtin_type
or global_entry.type.is_cpp_class):
return global_entry.type return global_entry.type
from .TreeFragment import TreeFragment from .TreeFragment import TreeFragment
......
# mode: compile
import cython
@cython.cclass
class BuiltinRef:
cython.declare(pybuf = 'Py_buffer')
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