Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
296e07f4
Commit
296e07f4
authored
May 11, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly look up module of superclass.
parent
b20ed8dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletion
+47
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+4
-1
tests/compile/cimported_class_base.srctree
tests/compile/cimported_class_base.srctree
+43
-0
No files found.
Cython/Compiler/Nodes.py
View file @
296e07f4
...
...
@@ -4535,7 +4535,10 @@ class CClassDefNode(ClassDefNode):
if
self
.
base_class_name
:
if
self
.
base_class_module
:
base_class_scope
=
env
.
find_module
(
self
.
base_class_module
,
self
.
pos
)
base_class_scope
=
env
.
find_imported_module
(
self
.
base_class_module
.
split
(
'.'
),
self
.
pos
)
if
not
base_class_scope
:
error
(
self
.
pos
,
"'%s' is not a cimported module"
%
self
.
base_class_module
)
return
else
:
base_class_scope
=
env
if
self
.
base_class_name
==
'object'
:
...
...
tests/compile/cimported_class_base.srctree
0 → 100644
View file @
296e07f4
PYTHON setup.py build_ext --inplace
######## setup.py ########
from Cython.Build import cythonize
from Cython.Distutils.extension import Extension
import sys
sys.path.append("path")
ext_modules = [
Extension("importer", ["importer.pyx"]),
]
ext_modules = cythonize(ext_modules, include_path=["include"])
######## pkg/__init__.py ########
######## pkg/a.pxd ########
cdef class A(object):
pass
######## importer.pyx ########
cimport pkg.a
cimport pkg.a as a
cimport pkg.a as a_by_another_name
from pkg cimport a as from_cimported_a
cdef class A1(a.A):
pass
cdef class A2(a_by_another_name.A):
pass
cdef class A3(pkg.a.A):
pass
cdef class A4(from_cimported_a.A):
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment