Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify PYPY check #703

Merged
merged 1 commit into from May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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