mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 00:14:46 +00:00
Log the attribute error for developers
This commit is contained in:
parent
da172ec641
commit
c11d33d917
1 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
"""Module containing our file processor that tokenizes a file for checks."""
|
"""Module containing our file processor that tokenizes a file for checks."""
|
||||||
import contextlib
|
import contextlib
|
||||||
import io
|
import io
|
||||||
|
import logging
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import tokenize
|
import tokenize
|
||||||
|
|
@ -10,6 +11,7 @@ from flake8 import defaults
|
||||||
from flake8 import exceptions
|
from flake8 import exceptions
|
||||||
from flake8 import utils
|
from flake8 import utils
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
PyCF_ONLY_AST = 1024
|
PyCF_ONLY_AST = 1024
|
||||||
NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE])
|
NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE])
|
||||||
# Work around Python < 2.6 behaviour, which does not generate NL after
|
# Work around Python < 2.6 behaviour, which does not generate NL after
|
||||||
|
|
@ -199,8 +201,13 @@ class FileProcessor(object):
|
||||||
if arguments is None:
|
if arguments is None:
|
||||||
arguments = {}
|
arguments = {}
|
||||||
for param in parameters:
|
for param in parameters:
|
||||||
if param not in arguments:
|
if param in arguments:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
arguments[param] = getattr(self, param)
|
arguments[param] = getattr(self, param)
|
||||||
|
except AttributeError as exc:
|
||||||
|
LOG.exception(exc)
|
||||||
|
raise
|
||||||
return arguments
|
return arguments
|
||||||
|
|
||||||
def check_physical_error(self, error_code, line):
|
def check_physical_error(self, error_code, line):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue