Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 573adec

Browse files
committed
Add deprecation warning for get_output and try_run: we should not use it anymore.
1 parent 0a570c7 commit 573adec

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

numpy/distutils/command/config.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Pearu Peterson
55

66
import os, signal
7+
import warnings
8+
79
from distutils.command.config import config as old_config
810
from distutils.command.config import LANG_EXT
911
from distutils import log
@@ -22,6 +24,17 @@ def initialize_options(self):
2224
self.fcompiler = None
2325
old_config.initialize_options(self)
2426

27+
def try_run(self, body, headers=None, include_dirs=None,
28+
libraries=None, library_dirs=None, lang="c"):
29+
warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \
30+
"Usage of try_run is deprecated: please do not \n" \
31+
"use it anymore, and avoid configuration checks \n" \
32+
"involving running executable on the target machine.\n" \
33+
"+++++++++++++++++++++++++++++++++++++++++++++++++\n",
34+
DeprecationWarning)
35+
return old_config.try_run(self, body, headers, include_dirs, libraries,
36+
library_dirs, lang)
37+
2538
def _check_compiler (self):
2639
old_config._check_compiler(self)
2740
from numpy.distutils.fcompiler import FCompiler, new_fcompiler
@@ -215,6 +228,12 @@ def get_output(self, body, headers=None, include_dirs=None,
215228
built from 'body' and 'headers'. Returns the exit status code
216229
of the program and its output.
217230
"""
231+
warnings.warn("\n+++++++++++++++++++++++++++++++++++++++++++++++++\n" \
232+
"Usage of get_output is deprecated: please do not \n" \
233+
"use it anymore, and avoid configuration checks \n" \
234+
"involving running executable on the target machine.\n" \
235+
"+++++++++++++++++++++++++++++++++++++++++++++++++\n",
236+
DeprecationWarning)
218237
from distutils.ccompiler import CompileError, LinkError
219238
self._check_compiler()
220239
exitcode, output = 255, ''

0 commit comments

Comments
 (0)