Commit 0e4a0434 authored by Stefan Behnel's avatar Stefan Behnel

fix Python level 'import as' of packages

parent dd5c9a50
...@@ -996,7 +996,8 @@ def p_import_statement(s): ...@@ -996,7 +996,8 @@ def p_import_statement(s):
else: else:
if as_name and "." in dotted_name: if as_name and "." in dotted_name:
name_list = ExprNodes.ListNode(pos, args = [ name_list = ExprNodes.ListNode(pos, args = [
ExprNodes.StringNode(pos, value = EncodedString("*"))]) ExprNodes.IdentifierStringNode(
pos, value = EncodedString("*"))])
else: else:
name_list = None name_list = None
stat = Nodes.SingleAssignmentNode(pos, stat = Nodes.SingleAssignmentNode(pos,
......
...@@ -2,6 +2,7 @@ __doc__ = u""" ...@@ -2,6 +2,7 @@ __doc__ = u"""
>>> import sys as sous >>> import sys as sous
>>> import distutils.core as corey >>> import distutils.core as corey
>>> from copy import deepcopy as copey >>> from copy import deepcopy as copey
>>> import distutils.command as commie
>>> sous is _sous >>> sous is _sous
True True
...@@ -9,6 +10,8 @@ True ...@@ -9,6 +10,8 @@ True
True True
>>> copey is _copey >>> copey is _copey
True True
>>> _commie is commie
True
>>> _sous is not None >>> _sous is not None
True True
...@@ -16,6 +19,8 @@ True ...@@ -16,6 +19,8 @@ True
True True
>>> _copey is not None >>> _copey is not None
True True
>>> _commie is not None
True
>>> print(_sous.__name__) >>> print(_sous.__name__)
sys sys
...@@ -29,8 +34,13 @@ distutils.core ...@@ -29,8 +34,13 @@ distutils.core
deepcopy deepcopy
>>> print(copey.__name__) >>> print(copey.__name__)
deepcopy deepcopy
>>> print(_commie.__name__)
distutils.command
>>> print(commie.__name__)
distutils.command
""" """
import sys as _sous import sys as _sous
import distutils.core as _corey import distutils.core as _corey
from copy import deepcopy as _copey from copy import deepcopy as _copey
import distutils.command as _commie
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