diff options
author | Anthony Sottile <asottile@umich.edu> | 2019-01-17 09:29:07 -0800 |
---|---|---|
committer | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2019-01-17 12:21:27 -0600 |
commit | 1f4e3772155ac5102e24b65ef3970d3f1454f4d4 (patch) | |
tree | acb02029c3b6d84a90240ca7cec06a87d52d4487 | |
parent | f1444872d7e4abfe1359778bca56ad3fd59a6f9b (diff) | |
download | pyflakes-1f4e3772155ac5102e24b65ef3970d3f1454f4d4.tar.gz |
Fix python3.8 docstring offsets
-rw-r--r-- | pyflakes/checker.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py index 3c4fa0f..4c18042 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -20,6 +20,7 @@ from pyflakes import messages PY2 = sys.version_info < (3, 0) 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 @@ -1073,7 +1074,7 @@ class Checker(object): if not isinstance(node, ast.Str): return (None, None) - if PYPY: + if PYPY or PY38_PLUS: doctest_lineno = node.lineno - 1 else: # Computed incorrectly if the docstring has backslash |