[Numpy-svn] r4746 - branches/build_with_scons/numpy/distutils

numpy-svn@scip... numpy-svn@scip...
Wed Jan 23 06:19:51 CST 2008


Author: cdavid
Date: 2008-01-23 06:19:44 -0600 (Wed, 23 Jan 2008)
New Revision: 4746

Modified:
   branches/build_with_scons/numpy/distutils/misc_util.py
Log:

Use eval instead of dynamic import in scons_generate_config_py, so that we do
not generate spurious *.pyc files.



Modified: branches/build_with_scons/numpy/distutils/misc_util.py
===================================================================
--- branches/build_with_scons/numpy/distutils/misc_util.py	2008-01-23 12:16:45 UTC (rev 4745)
+++ branches/build_with_scons/numpy/distutils/misc_util.py	2008-01-23 12:19:44 UTC (rev 4746)
@@ -1492,7 +1492,6 @@
     """
     from distutils.dir_util import mkpath
     from numscons import get_scons_configres_dir, get_scons_configres_filename
-    import imp
     d = {}
     mkpath(os.path.dirname(target))
     f = open(target, 'w')
@@ -1508,9 +1507,8 @@
             pkg_name = '.'.join(root[len(confdir)+1:].split(os.sep))
             fid = open(file, 'r')
             try:
-                config_mod = imp.load_module(pkg_name, fid, confilename,
-                                             ('.py', 'U', 1))
-                d[pkg_name] = config_mod.config
+                cnt = fid.read()
+                d[pkg_name] = eval(cnt)
             finally:
                 fid.close()
     # d is a dictionary whose keys are package names, and values the



More information about the Numpy-svn mailing list