diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 23:04:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 23:04:38 +0100 |
commit | 9e2ca978b211993066b0dc41da9aa63429655406 (patch) | |
tree | cb46fc9c1d42d7681a79be303292ee47b33d40b9 /scripts | |
parent | d8cb832f8cc7ef2695472ec0f752c59c72916274 (diff) | |
download | psutil-9e2ca978b211993066b0dc41da9aa63429655406.tar.gz |
Add support for PyPy on Windows (#1686)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/internal/winmake.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py index ac08c03f..fe0a73dc 100755 --- a/scripts/internal/winmake.py +++ b/scripts/internal/winmake.py @@ -36,6 +36,7 @@ GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" PY3 = sys.version_info[0] == 3 HERE = os.path.abspath(os.path.dirname(__file__)) ROOT_DIR = os.path.realpath(os.path.join(HERE, "..", "..")) +PYPY = '__pypy__' in sys.builtin_module_names DEPS = [ "coverage", "flake8", @@ -43,7 +44,6 @@ DEPS = [ "pdbpp", "pip", "pyperf", - "pypiwin32==219" if sys.version_info[:2] <= (3, 4) else "pypiwin32", "pyreadline", "setuptools", "wheel", @@ -56,6 +56,12 @@ if sys.version_info[:2] <= (2, 7): DEPS.append('mock') if sys.version_info[:2] <= (3, 2): DEPS.append('ipaddress') +if PYPY: + pass +elif sys.version_info[:2] <= (3, 4): + DEPS.append("pypiwin32==219") +else: + DEPS.append("pypiwin32") _cmds = {} if PY3: @@ -268,8 +274,8 @@ def upload_wheels(): def install_pip(): """Install pip""" try: - import pip # NOQA - except ImportError: + sh('%s -c "import pip"' % PYTHON) + except SystemExit: if PY3: from urllib.request import urlopen else: |