Skip to content

Commit

Permalink
simplify PYPY check (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed May 30, 2022
1 parent 30ec858 commit 405a090
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
6 changes: 1 addition & 5 deletions pyflakes/checker.py
Expand Up @@ -23,11 +23,7 @@
PY35_PLUS = sys.version_info >= (3, 5) # Python 3.5 and above
PY36_PLUS = sys.version_info >= (3, 6) # Python 3.6 and above
PY38_PLUS = sys.version_info >= (3, 8)
try:
sys.pypy_version_info
PYPY = True
except AttributeError:
PYPY = False
PYPY = hasattr(sys, 'pypy_version_info')

builtin_vars = dir(__import__('__builtin__' if PY2 else 'builtins'))

Expand Down
7 changes: 1 addition & 6 deletions pyflakes/test/test_api.py
Expand Up @@ -9,6 +9,7 @@
import subprocess
import tempfile

from pyflakes.checker import PYPY
from pyflakes.messages import UnusedImport
from pyflakes.reporter import Reporter
from pyflakes.api import (
Expand All @@ -25,12 +26,6 @@
from io import StringIO
unichr = chr

try:
sys.pypy_version_info
PYPY = True
except AttributeError:
PYPY = False

ERROR_HAS_COL_NUM = ERROR_HAS_LAST_LINE = sys.version_info >= (3, 2) or PYPY


Expand Down
7 changes: 1 addition & 6 deletions pyflakes/test/test_doctests.py
Expand Up @@ -3,6 +3,7 @@

from pyflakes import messages as m
from pyflakes.checker import (
PYPY,
DoctestScope,
FunctionScope,
ModuleScope,
Expand All @@ -12,12 +13,6 @@
from pyflakes.test.test_undefined_names import Test as TestUndefinedNames
from pyflakes.test.harness import TestCase, skip

try:
sys.pypy_version_info
PYPY = True
except AttributeError:
PYPY = False


class _DoctestMixin(object):

Expand Down

0 comments on commit 405a090

Please sign in to comment.