From 68d8900c6c03f16d83fafb48cbdee555ee47f132 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 10 Jun 2015 18:32:47 +0200 Subject: [PATCH] link_pyqt: Support PYTHON environment variable. --- scripts/link_pyqt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/link_pyqt.py b/scripts/link_pyqt.py index b35fed126..20e8e3e21 100644 --- a/scripts/link_pyqt.py +++ b/scripts/link_pyqt.py @@ -140,7 +140,10 @@ def get_python_lib(executable, venv=False): treatments for Windows/Ubuntu shouldn't take place. """ distribution = platform.linux_distribution(full_distribution_name=False) - if os.name == 'nt' and not venv: + if 'PYTHON' in os.environ and not venv: + # e.g. on AppVeyor + return os.path.join(os.environ['PYTHON'], 'Lib', 'site-packages') + elif os.name == 'nt' and not venv: # For some reason, we get an empty string from get_python_lib() on # Windows when running via tox, and sys.prefix is empty too... return os.path.join(os.path.dirname(executable), '..', 'Lib',