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
Gwenaël Samain
cython
Commits
0e4a0434
Commit
0e4a0434
authored
Nov 14, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Python level 'import as' of packages
parent
dd5c9a50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+2
-1
tests/run/importas.pyx
tests/run/importas.pyx
+10
-0
No files found.
Cython/Compiler/Parsing.py
View file @
0e4a0434
...
...
@@ -996,7 +996,8 @@ def p_import_statement(s):
else
:
if
as_name
and
"."
in
dotted_name
:
name_list
=
ExprNodes
.
ListNode
(
pos
,
args
=
[
ExprNodes
.
StringNode
(
pos
,
value
=
EncodedString
(
"*"
))])
ExprNodes
.
IdentifierStringNode
(
pos
,
value
=
EncodedString
(
"*"
))])
else
:
name_list
=
None
stat
=
Nodes
.
SingleAssignmentNode
(
pos
,
...
...
tests/run/importas.pyx
View file @
0e4a0434
...
...
@@ -2,6 +2,7 @@ __doc__ = u"""
>>> import sys as sous
>>> import distutils.core as corey
>>> from copy import deepcopy as copey
>>> import distutils.command as commie
>>> sous is _sous
True
...
...
@@ -9,6 +10,8 @@ True
True
>>> copey is _copey
True
>>> _commie is commie
True
>>> _sous is not None
True
...
...
@@ -16,6 +19,8 @@ True
True
>>> _copey is not None
True
>>> _commie is not None
True
>>> print(_sous.__name__)
sys
...
...
@@ -29,8 +34,13 @@ distutils.core
deepcopy
>>> print(copey.__name__)
deepcopy
>>> print(_commie.__name__)
distutils.command
>>> print(commie.__name__)
distutils.command
"""
import
sys
as
_sous
import
distutils.core
as
_corey
from
copy
import
deepcopy
as
_copey
import
distutils.command
as
_commie
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