Skip to content

Commit

Permalink
Update deprecated module usage.
Browse files Browse the repository at this point in the history
The sha module is deprecated.  Use hashlib.sha1 instead.  This fixes a
Python warning on startup.
  • Loading branch information
zewt committed Apr 28, 2011
1 parent 202d506 commit 62128f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions punjab/httpb.py
Expand Up @@ -13,7 +13,7 @@
except ImportError:
from twisted.xish import domish

import sha, time
import hashlib, time
import error
from session import make_session
import punjab
Expand Down Expand Up @@ -719,8 +719,7 @@ def parseBody(self, body, xmpp_elements):
try:
if body.hasAttribute('key') and not foundNewKey:
if s.key is not None:
nk = sha.new(body['key'])
key = nk.hexdigest()
key = hashlib.sha1(body['key']).hexdigest()
next_key = body['key']
if key == s.key:
s.key = next_key
Expand Down

0 comments on commit 62128f3

Please sign in to comment.