[Numpy-svn] r3187 - in trunk/numpy: numarray oldnumeric

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Sep 19 04:44:47 EDT 2006


Author: oliphant
Date: 2006-09-19 03:44:44 -0500 (Tue, 19 Sep 2006)
New Revision: 3187

Modified:
   trunk/numpy/numarray/alter_code1.py
   trunk/numpy/oldnumeric/alter_code1.py
Log:
Add one more import possibility.

Modified: trunk/numpy/numarray/alter_code1.py
===================================================================
--- trunk/numpy/numarray/alter_code1.py	2006-09-19 07:58:41 UTC (rev 3186)
+++ trunk/numpy/numarray/alter_code1.py	2006-09-19 08:44:44 UTC (rev 3187)
@@ -69,6 +69,8 @@
     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):

Modified: trunk/numpy/oldnumeric/alter_code1.py
===================================================================
--- trunk/numpy/oldnumeric/alter_code1.py	2006-09-19 07:58:41 UTC (rev 3186)
+++ trunk/numpy/oldnumeric/alter_code1.py	2006-09-19 08:44:44 UTC (rev 3187)
@@ -77,6 +77,8 @@
     fromstr = 'from %s import ' % name
     fromall=0
 
+    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))
 




More information about the Numpy-svn mailing list