[Scipy-svn] r6445 - in trunk/scipy/weave: . tests

scipy-svn at scipy.org scipy-svn at scipy.org
Sun May 30 08:37:10 EDT 2010


Author: rgommers
Date: 2010-05-30 07:37:10 -0500 (Sun, 30 May 2010)
New Revision: 6445

Modified:
   trunk/scipy/weave/build_tools.py
   trunk/scipy/weave/tests/test_build_tools.py
Log:
TST: Change print statement to warning for bad path in weave.

This plus the filter ensures it works as before in code, but the
test is not talking anymore.

Modified: trunk/scipy/weave/build_tools.py
===================================================================
--- trunk/scipy/weave/build_tools.py	2010-05-30 12:36:51 UTC (rev 6444)
+++ trunk/scipy/weave/build_tools.py	2010-05-30 12:37:10 UTC (rev 6445)
@@ -24,6 +24,7 @@
 import exceptions
 import commands
 import subprocess
+import warnings
 
 import platform_info
 
@@ -414,8 +415,9 @@
     # make sure build_dir exists and is writable
     if build_dir and (not os.path.exists(build_dir) or
                       not os.access(build_dir,os.W_OK)):
-        print "warning: specified build_dir '%s' does not exist " \
-               "or is not writable. Trying default locations" % build_dir
+        msg = "specified build_dir '%s' does not exist " \
+              "or is not writable. Trying default locations" % build_dir
+        warnings.warn(msg)
         build_dir = None
 
     if build_dir is None:

Modified: trunk/scipy/weave/tests/test_build_tools.py
===================================================================
--- trunk/scipy/weave/tests/test_build_tools.py	2010-05-30 12:36:51 UTC (rev 6444)
+++ trunk/scipy/weave/tests/test_build_tools.py	2010-05-30 12:37:10 UTC (rev 6445)
@@ -2,12 +2,17 @@
 # tests for MingW32Compiler
 # don't know how to test gcc_exists() and msvc_exists()...
 
-import os, sys, tempfile
+import os, sys, tempfile, warnings
 
 from numpy.testing import *
 
 from scipy.weave import build_tools
 
+# filter warnings generated by checking for bad paths
+warnings.filterwarnings('ignore',
+                message="specified build_dir",
+                module='scipy.weave')
+
 def is_writable(val):
     return os.access(val,os.W_OK)
 




More information about the Scipy-svn mailing list