Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb42678

Browse files
committed
Cleaner PYPY flag (platform module); Comment fixes
1 parent 7b0b09b commit eb42678

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

IPython/lib/pretty.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def _super_pprint(obj, p, cycle):
632632
p.pretty(obj.__thisclass__)
633633
p.text(',')
634634
p.breakable()
635-
if PYPY: # In PyPy, super() objects doesn't have __self__ attributes
635+
if PYPY: # In PyPy, super() objects don't have __self__ attributes
636636
dself = obj.__repr__.__self__
637637
p.pretty(None if dself is obj else dself)
638638
else:

IPython/utils/py3compat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import re
77
import shutil
88
import types
9+
import platform
910

1011
from .encoding import DEFAULT_ENCODING
1112

@@ -292,7 +293,7 @@ def execfile(fname, glob=None, loc=None, compiler=None):
292293

293294

294295
PY2 = not PY3
295-
PYPY = any(k.startswith("pypy") for k in dir(sys))
296+
PYPY = platform.python_implementation() == "PyPy"
296297

297298

298299
def annotate(**kwargs):

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
; -- Commands --
66
; pip install tox # Installs tox
77
; tox # Runs the tests (call from the directory with tox.ini)
8-
; tox -r # Runs rebuilding virtual environments
8+
; tox -r # Ditto, but forcing the virtual environments to be rebuilt
99
; tox -e py35,pypy # Runs only in the selected environments
1010
; tox -- --all -j # Runs "iptest --all -j" in every environment
1111

@@ -22,7 +22,7 @@ deps =
2222
py{36,35,34,33,27}: matplotlib
2323
.[test]
2424

25-
; It's just to avoid loading IPython module in the current directory
25+
; It's just to avoid loading the IPython package in the current directory
2626
changedir = {envtmpdir}
2727

2828
commands = iptest {posargs}

0 commit comments

Comments
 (0)