diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-19 08:44:44 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-19 08:44:44 +0000 |
commit | f54a116f84b82b4679dd803728d2fa08491ea613 (patch) | |
tree | 712b3a73ba4c6e2229b34421f28be7462183f147 /numpy/numarray/alter_code1.py | |
parent | 5be3af7f9288f503fc7fe08c97d53c920f235594 (diff) | |
download | numpy-f54a116f84b82b4679dd803728d2fa08491ea613.tar.gz |
Add one more import possibility.
Diffstat (limited to 'numpy/numarray/alter_code1.py')
-rw-r--r-- | numpy/numarray/alter_code1.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/numarray/alter_code1.py b/numpy/numarray/alter_code1.py index 634815289..f9dcf4a44 100644 --- a/numpy/numarray/alter_code1.py +++ b/numpy/numarray/alter_code1.py @@ -69,6 +69,8 @@ def changeimports(fstr, name, newname): if ('.' in name): name_ = name.replace('.','_') + fstr = re.sub(r'(import [^,]+,\s*)(%s)' % name, + "\\1%s as %s" % (newname, name), fstr) fstr = fstr.replace(importasstr, 'import %s as ' % newname) fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name_)) if (name_ != name): |