Skip to content

Commit 546a6c3

Browse files
committed
Avoid deprecation warning on sha and md5 libraries on Python >= 2.6
1 parent 6f40359 commit 546a6c3

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/core/convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424

2525

2626
try:
27-
import md5
28-
import sha
29-
except DeprecationWarning, _:
3027
from hashlib import md5
3128
from hashlib import sha
29+
except ImportError, _:
30+
import md5
31+
import sha
3232

3333
import struct
3434
import urllib

sqlmap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import sys
2929
import time
3030
import traceback
31+
import warnings
32+
33+
warnings.filterwarnings(action="ignore", message=".*(md5|sha) module is deprecated", category=DeprecationWarning)
3134

3235
try:
3336
import psyco

0 commit comments

Comments
 (0)