Skip to content

Commit a8d57bb

Browse files
committed
Avoid DeprecationWarning with Python 2.6+
1 parent 193482a commit a8d57bb

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

doc/THANKS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ Sven Schluter <sschlueter@netzwerk.cc>
116116
for providing with a patch for waiting a number of seconds between
117117
each HTTP request
118118

119+
Uemit Seren <uemit.seren@gmail.com>
120+
for reporting a minor adjustment when running with python 2.6
121+
119122
Sumit Siddharth <sid@notsosecure.com>
120123
for providing me with ideas on the implementation on a couple of
121124
features

lib/core/convert.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@
2323
"""
2424

2525

26+
try:
27+
import md5
28+
import sha
29+
except DeprecationWarning, _:
30+
from hashlib import md5
31+
from hashlib import sha
2632

27-
import md5
28-
import sha
2933
import struct
3034
import urllib
3135

lib/request/connect.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626

2727
import httplib
28-
import md5
2928
import re
3029
import socket
3130
import time

0 commit comments

Comments
 (0)