[Numpy-svn] r4275 - branches/numpy.scons/numpy/distutils/scons

numpy-svn@scip... numpy-svn@scip...
Wed Oct 24 00:20:14 CDT 2007


Author: cdavid
Date: 2007-10-24 00:20:02 -0500 (Wed, 24 Oct 2007)
New Revision: 4275

Modified:
   branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py
Log:
Catch no section exception when reading site.cfg in libinfo

Modified: branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py	2007-10-23 12:24:07 UTC (rev 4274)
+++ branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py	2007-10-24 05:20:02 UTC (rev 4275)
@@ -30,13 +30,16 @@
     
     Assumes that libs, symbol, header, libpath and cpppath are sequences (list
     or tuples). DO NOT USE DIRECTLY IN SCONSCRIPT !!!"""
-    # XXX: sanitize API for section/siteconfig option: if sectionis not given,
+    # XXX: sanitize API for section/siteconfig option: if section is not given,
     # can we just say to ignore the sitecfg ?
     if not siteconfig:
         siteconfig, cfgfiles = get_config()
 
     def get_descr():
-        descr = siteconfig.items(section)
+        try:
+            descr = siteconfig.items(section)
+        except ConfigParser.NoSectionError:
+            descr = ""
         sdescr = ""
         for i in descr:
             sdescr += str(i) + '\n'
@@ -66,9 +69,9 @@
     # recommended in C++ portability guide of mozilla for nested comments,
     # which may happen here). This is also the most robust, since it seems
     # unlikely to have any #endif somewhere in the return value of get_descr.
-    #src += "#if 0\n"
-    #src += get_descr()
-    #src += "\n#endif\n"
+    src += "#if 0\n"
+    src += get_descr()
+    src += "\n#endif\n"
 
     # XXX: handle autoadd
     # XXX: handle extension 



More information about the Numpy-svn mailing list