From 505b0f4c11acb1ade1e91f1360ffa6a33cbd0b51 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Fri, 19 Jun 2015 19:54:15 -0600 Subject: MAINT: Mark deprecation warning with a date and Numpy version. This is to make it easier to find and remove deprecated features. It would be a good idea if all deprecations were made with similar comments. --- numpy/distutils/command/config.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'numpy/distutils/command/config.py') diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 4f104b222..ddccef2e8 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -37,6 +37,7 @@ class config(old_config): def try_run(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c"): + # 2008-11-16, RemoveMe warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \ "Usage of try_run is deprecated: please do not \n" \ "use it anymore, and avoid configuration checks \n" \ @@ -435,6 +436,7 @@ int main (void) built from 'body' and 'headers'. Returns the exit status code of the program and its output. """ + # 2008-11-16, RemoveMe warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \ "Usage of get_output is deprecated: please do not \n" \ "use it anymore, and avoid configuration checks \n" \ -- cgit v1.2.1 From 3ed8030a2aa2f51a158fdec36a038a927ddb14b4 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sat, 20 Jun 2015 13:57:45 -0600 Subject: DEP,MAINT: Remove try_run and get_output. Deprecated functions in numpy/distutils/command/config.py. --- numpy/distutils/command/config.py | 57 --------------------------------------- 1 file changed, 57 deletions(-) (limited to 'numpy/distutils/command/config.py') diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index ddccef2e8..47dc17df3 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -35,18 +35,6 @@ class config(old_config): 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"): - # 2008-11-16, RemoveMe - 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 @@ -429,51 +417,6 @@ int main (void) def check_gcc_variable_attribute(self, attribute): return check_gcc_variable_attribute(self, attribute) - def get_output(self, body, headers=None, include_dirs=None, - libraries=None, library_dirs=None, - lang="c", use_tee=None): - """Try to compile, link to an executable, and run a program - built from 'body' and 'headers'. Returns the exit status code - of the program and its output. - """ - # 2008-11-16, RemoveMe - 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, '' - try: - grabber = GrabStdout() - try: - src, obj, exe = self._link(body, headers, include_dirs, - libraries, library_dirs, lang) - grabber.restore() - except: - output = grabber.data - grabber.restore() - raise - exe = os.path.join('.', exe) - exitstatus, output = exec_command(exe, execute_in='.', - use_tee=use_tee) - if hasattr(os, 'WEXITSTATUS'): - exitcode = os.WEXITSTATUS(exitstatus) - if os.WIFSIGNALED(exitstatus): - sig = os.WTERMSIG(exitstatus) - log.error('subprocess exited with signal %d' % (sig,)) - if sig == signal.SIGINT: - # control-C - raise KeyboardInterrupt - else: - exitcode = exitstatus - log.info("success!") - except (CompileError, LinkError): - log.info("failure.") - self._clean() - return exitcode, output class GrabStdout(object): -- cgit v1.2.1