Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJefry Lagrange <jefry.reyes@gmail.com>2012-01-25 01:51:26 +0400
committerJefry Lagrange <jefry.reyes@gmail.com>2012-01-25 01:51:26 +0400
commitb2897e36bbbf8bf4ba5746421fd108b4f9140ad3 (patch)
treea6c63a6d36df84c79a33ba25cbe0f38a3a7563d4 /src/common/xmpp
parentc02b43f88f04a58d770e3eca059dfb40b86222cf (diff)
better way to handle non supported hash algorithms
Diffstat (limited to 'src/common/xmpp')
-rw-r--r--src/common/xmpp/protocol.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/common/xmpp/protocol.py b/src/common/xmpp/protocol.py
index 007549691..3a8f092a7 100644
--- a/src/common/xmpp/protocol.py
+++ b/src/common/xmpp/protocol.py
@@ -1078,10 +1078,7 @@ class Hashes(Node):
elif algo == 'sha-512':
hl = hashlib.sha512()
- if hl == None:
- # Raise exception
- raise Exception('Hash algorithm not supported')
- else:
+ if hl:
hl.update(file_string)
hash_ = hl.hexdigest()
else: # if it is a file
@@ -1095,10 +1092,7 @@ class Hashes(Node):
elif algo == 'sha-512':
hl = hashlib.sha512()
- if hl == None:
- # Raise exception
- raise Exception('Hash algorithm not supported')
- else:
+ if hl:
for line in file_string:
hl.update(line)
hash_ = hl.hexdigest()