[Numpy-svn] r4149 - trunk/numpy/distutils

numpy-svn@scip... numpy-svn@scip...
Tue Oct 2 01:57:20 CDT 2007


Author: pearu
Date: 2007-10-02 01:57:10 -0500 (Tue, 02 Oct 2007)
New Revision: 4149

Modified:
   trunk/numpy/distutils/ccompiler.py
Log:
apply gen_lib_options overwrite only when a compiler module is imported

Modified: trunk/numpy/distutils/ccompiler.py
===================================================================
--- trunk/numpy/distutils/ccompiler.py	2007-10-02 06:21:37 UTC (rev 4148)
+++ trunk/numpy/distutils/ccompiler.py	2007-10-02 06:57:10 UTC (rev 4149)
@@ -388,9 +388,10 @@
 # from distutils.ccompiler import gen_lib_options
 # Don't bother with mwerks, as we don't support Classic Mac.
 for _cc in ['msvc', 'bcpp', 'cygwinc', 'emxc', 'unixc']:
-    _m = __import__('distutils.'+_cc+'compiler')
-    setattr(getattr(_m, _cc+'compiler'), 'gen_lib_options',
-            gen_lib_options)
+    _m = sys.modules.get('distutils.'+_cc+'compiler')
+    if _m is not None:
+        setattr(getattr(_m, _cc+'compiler'), 'gen_lib_options',
+                gen_lib_options)
 
 _distutils_gen_preprocess_options = gen_preprocess_options
 def gen_preprocess_options (macros, include_dirs):



More information about the Numpy-svn mailing list