Python: Stop py/import-deprecated-module from double alerting

This changes the location from the import statement, to the actual expression
This commit is contained in:
Rasmus Wriedt Larsen
2020-01-28 16:14:01 +01:00
parent 7949acc3ef
commit e92d6c0459
3 changed files with 13 additions and 11 deletions

View File

@@ -1,6 +1,4 @@
| test.py:2:1:2:13 | Import | The rfc822 module was deprecated in version 2.3. Use email module instead. |
| test.py:3:1:3:16 | Import | The posixfile module was deprecated in version 1.5. Use email module instead. |
| test.py:6:1:6:18 | ClassDef | The md5 module was deprecated in version 2.5. Use hashlib module instead. |
| test.py:7:5:7:18 | FunctionDef | The md5 module was deprecated in version 2.5. Use hashlib module instead. |
| test.py:8:9:8:18 | Import | The md5 module was deprecated in version 2.5. Use hashlib module instead. |
| test.py:14:5:14:23 | Import | The md5 module was deprecated in version 2.5. Use hashlib module instead. |
| test.py:2:8:2:13 | ImportExpr | The rfc822 module was deprecated in version 2.3. Use email module instead. |
| test.py:3:8:3:16 | ImportExpr | The posixfile module was deprecated in version 1.5. Use email module instead. |
| test.py:8:16:8:18 | ImportExpr | The md5 module was deprecated in version 2.5. Use hashlib module instead. |
| test.py:14:10:14:12 | ImportExpr | The md5 module was deprecated in version 2.5. Use hashlib module instead. |

View File

@@ -2,7 +2,7 @@
import rfc822
import posixfile
# TODO: We should only report a bad import once
# We should only report a bad import once
class Foo(object):
def foo(self):
import md5