diff --git a/lib/core/convert.py b/lib/core/convert.py index 121f2222e..0092d38a1 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -24,11 +24,11 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA try: - import md5 - import sha -except DeprecationWarning, _: from hashlib import md5 from hashlib import sha +except ImportError, _: + import md5 + import sha import struct import urllib diff --git a/sqlmap.py b/sqlmap.py index f22598575..923ef678e 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -28,6 +28,9 @@ import os import sys import time import traceback +import warnings + +warnings.filterwarnings(action="ignore", message=".*(md5|sha) module is deprecated", category=DeprecationWarning) try: import psyco