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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
b091fe65
Commit
b091fe65
authored
Jul 07, 2010
by
Craig Citro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly resolve imports of modules already cimported.
parent
2fccef53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+15
-6
No files found.
Cython/Compiler/Nodes.py
View file @
b091fe65
...
...
@@ -4988,17 +4988,26 @@ class FromImportStatNode(StatNode):
break
else
:
entry
=
env
.
lookup
(
target
.
name
)
if
(
entry
.
is_type
and
entry
.
type
.
name
==
name
and
entry
.
type
.
module_name
==
self
.
module
.
module_name
.
value
):
continue
# already cimported
# check whether or not entry is already cimported
if
(
entry
.
is_type
and
entry
.
type
.
name
==
name
and
hasattr
(
entry
.
type
,
'module_name'
)):
if
entry
.
type
.
module_name
==
self
.
module
.
module_name
.
value
:
# cimported with absolute name
continue
try
:
# cimported with relative name
module
=
env
.
find_module
(
self
.
module
.
module_name
.
value
,
pos
=
None
)
if
entry
.
type
.
module_name
==
module
.
qualified_name
:
continue
except
AttributeError
:
pass
target
.
analyse_target_expression
(
env
,
None
)
if
target
.
type
is
py_object_type
:
coerced_item
=
None
else
:
coerced_item
=
self
.
item
.
coerce_to
(
target
.
type
,
env
)
self
.
interned_items
.
append
(
(
name
,
target
,
coerced_item
))
self
.
interned_items
.
append
((
name
,
target
,
coerced_item
))
def
generate_execution_code
(
self
,
code
):
self
.
module
.
generate_evaluation_code
(
code
)
...
...
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