diff options
author | Michael W. Hudson <mwh@python.net> | 2003-06-27 12:32:39 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2003-06-27 12:32:39 (GMT) |
commit | 896e5164bb8562d0e5daeccd5f9f5f1d03aedeba (patch) | |
tree | 13cdcd23baef267c8afc1b0e71698d7ca1b21659 /Lib/compiler | |
parent | f69d9f6818225fc2613230c5dc11c181085db383 (diff) | |
download | cpython-896e5164bb8562d0e5daeccd5f9f5f1d03aedeba.zip cpython-896e5164bb8562d0e5daeccd5f9f5f1d03aedeba.tar.gz cpython-896e5164bb8562d0e5daeccd5f9f5f1d03aedeba.tar.bz2 |
Jacob Hallen cornered me here at EuroPython and got me to look at
patch:
[ 750008 ] 'compiler' module bug with 'import foo.bar as baz'
which I'm now checking in.
after import foo.bar as baz, baz would refer to foo.
Diffstat (limited to 'Lib/compiler')
-rw-r--r-- | Lib/compiler/pycodegen.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py index a6face0..009afbd 100644 --- a/Lib/compiler/pycodegen.py +++ b/Lib/compiler/pycodegen.py @@ -761,7 +761,11 @@ class CodeGenerator: self.emit('LOAD_CONST', None) self.emit('IMPORT_NAME', name) mod = name.split(".")[0] - self.storeName(alias or mod) + if alias: + self._resolveDots(name) + self.storeName(alias) + else: + self.storeName(mod) def visitFrom(self, node): self.set_lineno(node) |