Avoid deprecation warning on sha and md5 libraries on Python >= 2.6

This commit is contained in:
Bernardo Damele 2009-04-24 20:10:30 +00:00
parent 6f4035938b
commit 546a6c32e3
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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