summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2022-10-13 09:43:25 +0200
committerDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2022-10-13 10:28:40 +0200
commiteba83419b0668d2609a4f15a43eddf921813037f (patch)
tree3bd18b05f5debd15763e26223efdcc229bf45097
parent22c540ca17cf2e9a837cb543d581c13a71481fb3 (diff)
downloadnumpy-eba83419b0668d2609a4f15a43eddf921813037f.tar.gz
MAINT: always use sys.base_prefix, never use sys.real_prefix
`sys.base_prefix` was introduced in Python 3.3, so it will always be available in supported versions of Python >= 3.3: https://docs.python.org/3/library/sys.html#sys.base_prefix As a result, `sys.real_prefix` will never be used in supported versions of Python >= 3.3. Besides, it has been removed from recent versions of virtualenv: https://github.com/pypa/virtualenv/issues/1622
-rw-r--r--numpy/distutils/mingw32ccompiler.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py
index 3349a56e8..5d1c27a65 100644
--- a/numpy/distutils/mingw32ccompiler.py
+++ b/numpy/distutils/mingw32ccompiler.py
@@ -184,14 +184,11 @@ def find_python_dll():
# We can't do much here:
# - find it in the virtualenv (sys.prefix)
# - find it in python main dir (sys.base_prefix, if in a virtualenv)
- # - sys.real_prefix is main dir for virtualenvs in Python 2.7
# - in system32,
# - ortherwise (Sxs), I don't know how to get it.
stems = [sys.prefix]
- if hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix:
+ if sys.base_prefix != sys.prefix:
stems.append(sys.base_prefix)
- elif hasattr(sys, 'real_prefix') and sys.real_prefix != sys.prefix:
- stems.append(sys.real_prefix)
sub_dirs = ['', 'lib', 'bin']
# generate possible combinations of directory trees and sub-directories