From eb42678a5d2e36e64e72e2b8aba2d1cac4030c57 2016-08-02 08:17:14 From: Danilo J. S. Bellini Date: 2016-08-02 08:17:14 Subject: [PATCH] Cleaner PYPY flag (platform module); Comment fixes --- diff --git a/IPython/lib/pretty.py b/IPython/lib/pretty.py index 057d1ee..97529f1 100644 --- a/IPython/lib/pretty.py +++ b/IPython/lib/pretty.py @@ -632,7 +632,7 @@ def _super_pprint(obj, p, cycle): p.pretty(obj.__thisclass__) p.text(',') p.breakable() - if PYPY: # In PyPy, super() objects doesn't have __self__ attributes + if PYPY: # In PyPy, super() objects don't have __self__ attributes dself = obj.__repr__.__self__ p.pretty(None if dself is obj else dself) else: diff --git a/IPython/utils/py3compat.py b/IPython/utils/py3compat.py index 2e7f5bb..88602e5 100644 --- a/IPython/utils/py3compat.py +++ b/IPython/utils/py3compat.py @@ -6,6 +6,7 @@ import sys import re import shutil import types +import platform from .encoding import DEFAULT_ENCODING @@ -292,7 +293,7 @@ else: PY2 = not PY3 -PYPY = any(k.startswith("pypy") for k in dir(sys)) +PYPY = platform.python_implementation() == "PyPy" def annotate(**kwargs): diff --git a/tox.ini b/tox.ini index 465b75d..1668ce6 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ ; -- Commands -- ; pip install tox # Installs tox ; tox # Runs the tests (call from the directory with tox.ini) -; tox -r # Runs rebuilding virtual environments +; tox -r # Ditto, but forcing the virtual environments to be rebuilt ; tox -e py35,pypy # Runs only in the selected environments ; tox -- --all -j # Runs "iptest --all -j" in every environment @@ -22,7 +22,7 @@ deps = py{36,35,34,33,27}: matplotlib .[test] -; It's just to avoid loading IPython module in the current directory +; It's just to avoid loading the IPython package in the current directory changedir = {envtmpdir} commands = iptest {posargs}