diff options
author | David Cournapeau <cournape@gmail.com> | 2008-01-23 12:19:44 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-01-23 12:19:44 +0000 |
commit | 7bce5e9ecaeec970396713d0418f8a083a46a19a (patch) | |
tree | 620549048ccd42cd1b0481d35d7b09f0d3464313 /numpy/distutils/misc_util.py | |
parent | c9c4c25267c9b31a2dc4e0cdad420da509de2bda (diff) | |
download | numpy-7bce5e9ecaeec970396713d0418f8a083a46a19a.tar.gz |
Use eval instead of dynamic import in scons_generate_config_py, so that we do
not generate spurious *.pyc files.
Diffstat (limited to 'numpy/distutils/misc_util.py')
-rw-r--r-- | numpy/distutils/misc_util.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index 9bf830895..a698ae415 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -1492,7 +1492,6 @@ def scons_generate_config_py(target): """ 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 @@ def scons_generate_config_py(target): 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 |