Skip to content

Commit 3ed8030

Browse files
committed
DEP,MAINT: Remove try_run and get_output.
Deprecated functions in numpy/distutils/command/config.py.
1 parent 16f1622 commit 3ed8030

File tree

2 files changed

+4
-58
lines changed

2 files changed

+4
-58
lines changed

doc/release/1.10.0-notes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ Dropped Support:
2525
* The polytemplate.py file has been removed.
2626
* The _dotblas module is no longer available.
2727
* The testcalcs.py file has been removed.
28-
* npy_PyFile_Dup`` and npy_PyFile_DupClose have been removed from
28+
* npy_PyFile_Dup and npy_PyFile_DupClose have been removed from
2929
npy_3kcompat.h.
3030
* splitcmdline has been removed from numpy/distutils/exec_command.py.
31+
* try_run and get_output have been removed from
32+
numpy/distutils/command/config.py
33+
*
3134

3235
Future Changes:
3336

numpy/distutils/command/config.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ def initialize_options(self):
3535
self.fcompiler = None
3636
old_config.initialize_options(self)
3737

38-
def try_run(self, body, headers=None, include_dirs=None,
39-
libraries=None, library_dirs=None, lang="c"):
40-
# 2008-11-16, RemoveMe
41-
warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \
42-
"Usage of try_run is deprecated: please do not \n" \
43-
"use it anymore, and avoid configuration checks \n" \
44-
"involving running executable on the target machine.\n" \
45-
"+++++++++++++++++++++++++++++++++++++++++++++++++\n",
46-
DeprecationWarning)
47-
return old_config.try_run(self, body, headers, include_dirs, libraries,
48-
library_dirs, lang)
49-
5038
def _check_compiler (self):
5139
old_config._check_compiler(self)
5240
from numpy.distutils.fcompiler import FCompiler, new_fcompiler
@@ -429,51 +417,6 @@ def check_gcc_function_attribute(self, attribute, name):
429417
def check_gcc_variable_attribute(self, attribute):
430418
return check_gcc_variable_attribute(self, attribute)
431419

432-
def get_output(self, body, headers=None, include_dirs=None,
433-
libraries=None, library_dirs=None,
434-
lang="c", use_tee=None):
435-
"""Try to compile, link to an executable, and run a program
436-
built from 'body' and 'headers'. Returns the exit status code
437-
of the program and its output.
438-
"""
439-
# 2008-11-16, RemoveMe
440-
warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \
441-
"Usage of get_output is deprecated: please do not \n" \
442-
"use it anymore, and avoid configuration checks \n" \
443-
"involving running executable on the target machine.\n" \
444-
"+++++++++++++++++++++++++++++++++++++++++++++++++\n",
445-
DeprecationWarning)
446-
from distutils.ccompiler import CompileError, LinkError
447-
self._check_compiler()
448-
exitcode, output = 255, ''
449-
try:
450-
grabber = GrabStdout()
451-
try:
452-
src, obj, exe = self._link(body, headers, include_dirs,
453-
libraries, library_dirs, lang)
454-
grabber.restore()
455-
except:
456-
output = grabber.data
457-
grabber.restore()
458-
raise
459-
exe = os.path.join('.', exe)
460-
exitstatus, output = exec_command(exe, execute_in='.',
461-
use_tee=use_tee)
462-
if hasattr(os, 'WEXITSTATUS'):
463-
exitcode = os.WEXITSTATUS(exitstatus)
464-
if os.WIFSIGNALED(exitstatus):
465-
sig = os.WTERMSIG(exitstatus)
466-
log.error('subprocess exited with signal %d' % (sig,))
467-
if sig == signal.SIGINT:
468-
# control-C
469-
raise KeyboardInterrupt
470-
else:
471-
exitcode = exitstatus
472-
log.info("success!")
473-
except (CompileError, LinkError):
474-
log.info("failure.")
475-
self._clean()
476-
return exitcode, output
477420

478421
class GrabStdout(object):
479422

0 commit comments

Comments
 (0)