[Numpy-svn] r6050 - trunk/numpy/distutils/command

numpy-svn at scipy.org numpy-svn at scipy.org
Sun Nov 16 07:30:24 EST 2008


Author: cdavid
Date: 2008-11-16 06:30:17 -0600 (Sun, 16 Nov 2008)
New Revision: 6050

Modified:
   trunk/numpy/distutils/command/config.py
Log:
Add deprecation warning for get_output and try_run: we should not use it anymore.

Modified: trunk/numpy/distutils/command/config.py
===================================================================
--- trunk/numpy/distutils/command/config.py	2008-11-16 11:45:09 UTC (rev 6049)
+++ trunk/numpy/distutils/command/config.py	2008-11-16 12:30:17 UTC (rev 6050)
@@ -4,6 +4,8 @@
 # Pearu Peterson
 
 import os, signal
+import warnings
+
 from distutils.command.config import config as old_config
 from distutils.command.config import LANG_EXT
 from distutils import log
@@ -22,6 +24,17 @@
         self.fcompiler = None
         old_config.initialize_options(self)
 
+    def try_run(self, body, headers=None, include_dirs=None,
+                libraries=None, library_dirs=None, lang="c"):
+        warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \
+                      "Usage of try_run is deprecated: please do not \n" \
+                      "use it anymore, and avoid configuration checks \n" \
+                      "involving running executable on the target machine.\n" \
+                      "+++++++++++++++++++++++++++++++++++++++++++++++++\n",
+                      DeprecationWarning)
+        return old_config.try_run(self, body, headers, include_dirs, libraries,
+                                  library_dirs, lang)
+
     def _check_compiler (self):
         old_config._check_compiler(self)
         from numpy.distutils.fcompiler import FCompiler, new_fcompiler
@@ -215,6 +228,12 @@
         built from 'body' and 'headers'. Returns the exit status code
         of the program and its output.
         """
+        warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \
+                      "Usage of get_output is deprecated: please do not \n" \
+                      "use it anymore, and avoid configuration checks \n" \
+                      "involving running executable on the target machine.\n" \
+                      "+++++++++++++++++++++++++++++++++++++++++++++++++\n",
+                      DeprecationWarning)
         from distutils.ccompiler import CompileError, LinkError
         self._check_compiler()
         exitcode, output = 255, ''




More information about the Numpy-svn mailing list