[Numpy-svn] r8265 - trunk/numpy/f2py

numpy-svn@scip... numpy-svn@scip...
Wed Feb 24 23:20:44 CST 2010


Author: charris
Date: 2010-02-24 23:20:44 -0600 (Wed, 24 Feb 2010)
New Revision: 8265

Modified:
   trunk/numpy/f2py/diagnose.py
Log:
BUG: Fix imports in diagnose and excise old crap.

Modified: trunk/numpy/f2py/diagnose.py
===================================================================
--- trunk/numpy/f2py/diagnose.py	2010-02-25 05:20:39 UTC (rev 8264)
+++ trunk/numpy/f2py/diagnose.py	2010-02-25 05:20:44 UTC (rev 8265)
@@ -1,6 +1,8 @@
 #!/usr/bin/env python
 
-import os,sys,tempfile
+import os
+import sys
+import tempfile
 
 def run_command(cmd):
     print 'Running %r:' % (cmd)
@@ -22,30 +24,21 @@
     print '------'
     print 'sys.path=%r' % (':'.join(sys.path))
     print '------'
+
     try:
-        import Numeric
-        has_Numeric = 1
-    except ImportError:
-        print 'Failed to import Numeric:',sys.exc_value
-        has_Numeric = 0
-    try:
-        import numarray
-        has_numarray = 1
-    except ImportError:
-        print 'Failed to import numarray:',sys.exc_value
-        has_numarray = 0
-    try:
         import numpy
         has_newnumpy = 1
     except ImportError:
         print 'Failed to import new numpy:', sys.exc_value
         has_newnumpy = 0
+
     try:
-        import f2py2e
+        from numpy.f2py import f2py2e
         has_f2py2e = 1
     except ImportError:
         print 'Failed to import f2py2e:',sys.exc_value
         has_f2py2e = 0
+
     try:
         import numpy.distutils
         has_numpy_distutils = 2
@@ -56,20 +49,7 @@
         except ImportError:
             print 'Failed to import numpy_distutils:',sys.exc_value
             has_numpy_distutils = 0
-    if has_Numeric:
-        try:
-            print 'Found Numeric version %r in %s' % \
-                  (Numeric.__version__,Numeric.__file__)
-        except Exception,msg:
-            print 'error:',msg
-            print '------'
-    if has_numarray:
-        try:
-            print 'Found numarray version %r in %s' % \
-                  (numarray.__version__,numarray.__file__)
-        except Exception,msg:
-            print 'error:',msg
-            print '------'
+
     if has_newnumpy:
         try:
             print 'Found new numpy version %r in %s' % \
@@ -77,6 +57,7 @@
         except Exception,msg:
             print 'error:', msg
             print '------'
+
     if has_f2py2e:
         try:
             print 'Found f2py2e version %r in %s' % \
@@ -84,9 +65,10 @@
         except Exception,msg:
             print 'error:',msg
             print '------'
+
     if has_numpy_distutils:
         try:
-            if has_numpy_distutils==2:
+            if has_numpy_distutils == 2:
                 print 'Found numpy.distutils version %r in %r' % (\
             numpy.distutils.__version__,
             numpy.distutils.__file__)
@@ -99,7 +81,7 @@
             print 'error:',msg
             print '------'
         try:
-            if has_numpy_distutils==1:
+            if has_numpy_distutils == 1:
                 print 'Importing numpy_distutils.command.build_flib ...',
                 import numpy_distutils.command.build_flib as build_flib
                 print 'ok'
@@ -116,7 +98,7 @@
             print 'error:',msg,'(ignore it, build_flib is obsolute for numpy.distutils 0.2.2 and up)'
             print '------'
         try:
-            if has_numpy_distutils==2:
+            if has_numpy_distutils == 2:
                 print 'Importing numpy.distutils.fcompiler ...',
                 import numpy.distutils.fcompiler as fcompiler
             else:
@@ -135,7 +117,7 @@
             print 'error:',msg
             print '------'
         try:
-            if has_numpy_distutils==2:
+            if has_numpy_distutils == 2:
                 print 'Importing numpy.distutils.cpuinfo ...',
                 from numpy.distutils.cpuinfo import cpuinfo
                 print 'ok'



More information about the Numpy-svn mailing list