8000 1.10 deprecated removal by charris · Pull Request #5990 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

1.10 deprecated removal #5990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 21, 2015
Prev Previous commit
Next Next commit
DEP,MAINT: Remove try_run and get_output.
Deprecated functions in numpy/distutils/command/config.py.
  • Loading branch information
charris committed Jun 21, 2015
commit 3ed8030a2aa2f51a158fdec36a038a927ddb14b4
5 changes: 4 additions & 1 deletion doc/release/1.10.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ Dropped Support:
* The polytemplate.py file has been removed.
* The _dotblas module is no longer available.
* The testcalcs.py file has been removed.
* npy_PyFile_Dup`` and npy_PyFile_DupClose have been removed from
* npy_PyFile_Dup and npy_PyFile_DupClose have been removed from
npy_3kcompat.h.
* splitcmdline has been removed from numpy/distutils/exec_command.py.
* try_run and get_output have been removed from
numpy/distutils/command/config.py
*

Future Changes:

Expand Down
57 changes: 0 additions & 57 deletions numpy/distutils/command/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ def initialize_options(self):
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
Expand Down Expand Up @@ -429,51 +417,6 @@ def check_gcc_function_attribute(self, attribute, name):
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()
4852 return exitcode, output

class GrabStdout(object):

Expand Down
0