From eba83419b0668d2609a4f15a43eddf921813037f Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 13 Oct 2022 09:43:25 +0200 Subject: 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 --- numpy/distutils/mingw32ccompiler.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'numpy') 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 -- cgit v1.2.1