diff options
Diffstat (limited to 'pyflakes/api.py')
-rw-r--r-- | pyflakes/api.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pyflakes/api.py b/pyflakes/api.py index 6226e5d..50e8ad8 100644 --- a/pyflakes/api.py +++ b/pyflakes/api.py @@ -14,7 +14,7 @@ from pyflakes import reporter as modReporter __all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main'] -PYTHON_SHEBANG_REGEX = re.compile(br'^#!.*\bpython[23w]?\b\s*$') +PYTHON_SHEBANG_REGEX = re.compile(br'^#!.*\bpython([23](\.\d+)?|w)?[dmu]?\s') def check(codeString, filename, reporter=None): @@ -118,8 +118,7 @@ def isPythonFile(filename): except IOError: return False - first_line = text.splitlines()[0] - return PYTHON_SHEBANG_REGEX.match(first_line) + return PYTHON_SHEBANG_REGEX.match(text) def iterSourceCode(paths): |