diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-02-16 18:05:00 -0800 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-02-16 18:05:00 -0800 |
| commit | a252a0b1386ee815833f2edae0ffa45aa23032ac (patch) | |
| tree | bb17cba2a2d4615f52f16370acc94261dc564f8f | |
| parent | 684ffb3306af89e4092c4598aa9ae4294eb52eb8 (diff) | |
| download | flake8-a252a0b1386ee815833f2edae0ffa45aa23032ac.tar.gz | |
Remove pyflakes monkeypatching
| -rw-r--r-- | src/flake8/plugins/pyflakes.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/flake8/plugins/pyflakes.py b/src/flake8/plugins/pyflakes.py index d4556c5..2f233c4 100644 --- a/src/flake8/plugins/pyflakes.py +++ b/src/flake8/plugins/pyflakes.py @@ -53,16 +53,6 @@ FLAKE8_PYFLAKES_CODES = { } -def patch_pyflakes(): - """Add error codes to Pyflakes messages.""" - for name, obj in vars(pyflakes.messages).items(): - if name[0].isupper() and obj.message: - obj.flake8_code = FLAKE8_PYFLAKES_CODES.get(name, "F999") - - -patch_pyflakes() - - class FlakesChecker(pyflakes.checker.Checker): """Subclass the Pyflakes checker to conform with the flake8 API.""" @@ -186,7 +176,7 @@ class FlakesChecker(pyflakes.checker.Checker): message.lineno, col, "{} {}".format( - message.flake8_code, + FLAKE8_PYFLAKES_CODES.get(type(message).__name__, "F999"), message.message % message.message_args, ), message.__class__, |
