summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2010-01-27 19:38:31 -0800
committerNathan Fritz <fritzy@netflint.net>2010-01-27 19:38:31 -0800
commit8ad32d20655c7aac712cf59f70560a89e625c929 (patch)
treed44747fd57f1f729cbafd784354ca14fc543b164
parent50ec99eee0e15d6b8d5edcf167eb59d558e0a2c6 (diff)
parentf159328dc436632450e09ed4a2992e7e7f9afde4 (diff)
downloadslixmpp-8ad32d20655c7aac712cf59f70560a89e625c929.tar.gz
slixmpp-8ad32d20655c7aac712cf59f70560a89e625c929.tar.bz2
slixmpp-8ad32d20655c7aac712cf59f70560a89e625c929.tar.xz
slixmpp-8ad32d20655c7aac712cf59f70560a89e625c929.zip
Merge branch 'master' of git@github.com:fritzy/SleekXMPP
-rwxr-xr-xsleekxmpp/componentxmpp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py
index 4f1a190e..5bd596d2 100755
--- a/sleekxmpp/componentxmpp.py
+++ b/sleekxmpp/componentxmpp.py
@@ -76,7 +76,10 @@ class ComponentXMPP(basexmpp, XMLStream):
def start_stream_handler(self, xml):
sid = xml.get('id', '')
handshake = ET.Element('{jabber:component:accept}handshake')
- handshake.text = hashlib.sha1(bytes("%s%s" % (sid, self.secret), 'utf-8')).hexdigest().lower()
+ if sys.version_info < (3,0):
+ handshake.text = hashlib.sha1("%s%s" % (sid, self.secret)).hexdigest().lower()
+ else:
+ handshake.text = hashlib.sha1(bytes("%s%s" % (sid, self.secret), 'utf-8')).hexdigest().lower()
self.sendXML(handshake)
def _handleHandshake(self, xml):