From 546a6c32e36b474c55ee033417160d89f194b211 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 24 Apr 2009 20:10:30 +0000 Subject: [PATCH] Avoid deprecation warning on sha and md5 libraries on Python >= 2.6 --- lib/core/convert.py | 6 +++--- sqlmap.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) 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