[Numpy-svn] r4464 - branches/numpy.scons/numpy/distutils/scons/tools

numpy-svn@scip... numpy-svn@scip...
Fri Nov 16 05:35:15 CST 2007


Author: cdavid
Date: 2007-11-16 05:35:11 -0600 (Fri, 16 Nov 2007)
New Revision: 4464

Modified:
   branches/numpy.scons/numpy/distutils/scons/tools/f2py.py
Log:
Handle copying errors of fortran source files in f2py tool

Modified: branches/numpy.scons/numpy/distutils/scons/tools/f2py.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/tools/f2py.py	2007-11-16 11:28:06 UTC (rev 4463)
+++ branches/numpy.scons/numpy/distutils/scons/tools/f2py.py	2007-11-16 11:35:11 UTC (rev 4464)
@@ -48,9 +48,18 @@
 
     # Copy source files for f2py generated modules in the build dir
     build_dir = os.path.dirname(target_file_names[0])
-    shutil.copy(source_c, build_dir)
-    shutil.copy(source_h, build_dir)
 
+    # XXX: blah
+    if build_dir == '':
+        build_dir = '.'
+
+    try:
+        shutil.copy(source_c, build_dir)
+        shutil.copy(source_h, build_dir)
+    except IOError, e:
+        msg = "Error while copying fortran source files (error was %s)" % str(e)
+        raise IOError(msg)
+
     # Generate the source file from pyf description
     haha = numpy.f2py.run_main(['--build-dir', build_dir,
                                 source_file_names[0]])



More information about the Numpy-svn mailing list