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

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Sep 20 19:03:56 CDT 2006


Author: oliphant
Date: 2006-09-20 19:02:22 -0500 (Wed, 20 Sep 2006)
New Revision: 3201

Modified:
   trunk/numpy/numarray/alter_code1.py
   trunk/numpy/oldnumeric/alter_code1.py
Log:
Fix problem with alter_code1.py

Modified: trunk/numpy/numarray/alter_code1.py
===================================================================
--- trunk/numpy/numarray/alter_code1.py	2006-09-20 19:17:56 UTC (rev 3200)
+++ trunk/numpy/numarray/alter_code1.py	2006-09-21 00:02:22 UTC (rev 3201)
@@ -69,7 +69,7 @@
     if ('.' in name):
         name_ = name.replace('.','_')
 
-    fstr = re.sub(r'(import [^,]+,\s*)(%s)' % name,
+    fstr = re.sub(r'(import\s+[^,\n\r]+,\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_))

Modified: trunk/numpy/oldnumeric/alter_code1.py
===================================================================
--- trunk/numpy/oldnumeric/alter_code1.py	2006-09-20 19:17:56 UTC (rev 3200)
+++ trunk/numpy/oldnumeric/alter_code1.py	2006-09-21 00:02:22 UTC (rev 3201)
@@ -77,7 +77,7 @@
     fromstr = 'from %s import ' % name
     fromall=0
 
-    fstr = re.sub(r'(import [^,]+,\s*)(%s)' % name,
+    fstr = re.sub(r'(import\s+[^,\n\r]+,\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