mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 23:54:17 +00:00
Merged in asksol/flake8 (pull request #8)
This commit is contained in:
commit
603dd96ae3
2 changed files with 9 additions and 2 deletions
|
|
@ -117,6 +117,7 @@ MAX_LINE_LENGTH = 79
|
||||||
|
|
||||||
INDENT_REGEX = re.compile(r'([ \t]*)')
|
INDENT_REGEX = re.compile(r'([ \t]*)')
|
||||||
RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*(,)')
|
RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*(,)')
|
||||||
|
QUOTED_REGEX = re.compile(r"""([""'])(?:(?=(\\?))\2.)*?\1""")
|
||||||
SELFTEST_REGEX = re.compile(r'(Okay|[EW]\d{3}):\s(.*)')
|
SELFTEST_REGEX = re.compile(r'(Okay|[EW]\d{3}):\s(.*)')
|
||||||
ERRORCODE_REGEX = re.compile(r'[EW]\d{3}')
|
ERRORCODE_REGEX = re.compile(r'[EW]\d{3}')
|
||||||
DOCSTRING_REGEX = re.compile(r'u?r?["\']')
|
DOCSTRING_REGEX = re.compile(r'u?r?["\']')
|
||||||
|
|
@ -690,7 +691,10 @@ def python_3000_raise_comma(logical_line):
|
||||||
"""
|
"""
|
||||||
match = RAISE_COMMA_REGEX.match(logical_line)
|
match = RAISE_COMMA_REGEX.match(logical_line)
|
||||||
if match:
|
if match:
|
||||||
return match.start(1), "W602 deprecated form of raising exception"
|
rest = QUOTED_REGEX.sub("", logical_line)
|
||||||
|
# but allow three argument form of raise
|
||||||
|
if rest.count(",") == 1:
|
||||||
|
return match.start(1), "W602 deprecated form of raising exception"
|
||||||
|
|
||||||
|
|
||||||
def python_3000_not_equal(logical_line):
|
def python_3000_not_equal(logical_line):
|
||||||
|
|
|
||||||
5
setup.py
5
setup.py
|
|
@ -1,4 +1,7 @@
|
||||||
from distutils.core import setup
|
try:
|
||||||
|
from setuptools import setup
|
||||||
|
except ImportError:
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
README = open('README').read()
|
README = open('README').read()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue