Python: py/import-deprecated-module handle backwards compatible code

This commit is contained in:
Rasmus Wriedt Larsen
2020-01-28 16:36:47 +01:00
parent e92d6c0459
commit 6c7cddf258
4 changed files with 13 additions and 4 deletions

View File

@@ -1,4 +1,3 @@
| 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

@@ -7,7 +7,7 @@ class Foo(object):
def foo(self):
import md5
# TODO: Backwards compatible code, should not report
# Backwards compatible code, should not report
try:
from hashlib import md5
except ImportError: