cython-devel
changeset 1338:c50ea4f4ba4e
fix Python level 'import as' of packages
| author | Stefan Behnel <scoder@users.berlios.de> |
|---|---|
| date | Fri Nov 14 21:53:41 2008 +0100 (3 years ago) |
| parents | c0f27ff5a5c6 |
| children | 41c4fac0db71 |
| files | Cython/Compiler/Parsing.py tests/run/importas.pyx |
line diff
1.1 --- a/Cython/Compiler/Parsing.py Fri Nov 14 21:07:22 2008 +0100
1.2 +++ b/Cython/Compiler/Parsing.py Fri Nov 14 21:53:41 2008 +0100
1.3 @@ -996,7 +996,8 @@
1.4 else:
1.5 if as_name and "." in dotted_name:
1.6 name_list = ExprNodes.ListNode(pos, args = [
1.7 - ExprNodes.StringNode(pos, value = EncodedString("*"))])
1.8 + ExprNodes.IdentifierStringNode(
1.9 + pos, value = EncodedString("*"))])
1.10 else:
1.11 name_list = None
1.12 stat = Nodes.SingleAssignmentNode(pos,
2.1 --- a/tests/run/importas.pyx Fri Nov 14 21:07:22 2008 +0100
2.2 +++ b/tests/run/importas.pyx Fri Nov 14 21:53:41 2008 +0100
2.3 @@ -2,6 +2,7 @@
2.4 >>> import sys as sous
2.5 >>> import distutils.core as corey
2.6 >>> from copy import deepcopy as copey
2.7 +>>> import distutils.command as commie
2.8
2.9 >>> sous is _sous
2.10 True
2.11 @@ -9,6 +10,8 @@
2.12 True
2.13 >>> copey is _copey
2.14 True
2.15 +>>> _commie is commie
2.16 +True
2.17
2.18 >>> _sous is not None
2.19 True
2.20 @@ -16,6 +19,8 @@
2.21 True
2.22 >>> _copey is not None
2.23 True
2.24 +>>> _commie is not None
2.25 +True
2.26
2.27 >>> print(_sous.__name__)
2.28 sys
2.29 @@ -29,8 +34,13 @@
2.30 deepcopy
2.31 >>> print(copey.__name__)
2.32 deepcopy
2.33 +>>> print(_commie.__name__)
2.34 +distutils.command
2.35 +>>> print(commie.__name__)
2.36 +distutils.command
2.37 """
2.38
2.39 import sys as _sous
2.40 import distutils.core as _corey
2.41 from copy import deepcopy as _copey
2.42 +import distutils.command as _commie
