summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2010-01-27 15:09:23 -0800
committerNathan Fritz <fritzy@netflint.net>2010-01-27 15:09:23 -0800
commita4ec7413e4dc9246f4612b73fca9b9d842287e44 (patch)
treeda02bf9169ca30efc3ef30422ce5e865a02e815e /sleekxmpp
parent65dd83d4e174fc5f88ea90b32dd9e3ebf1787294 (diff)
downloadslixmpp-a4ec7413e4dc9246f4612b73fca9b9d842287e44.tar.gz
slixmpp-a4ec7413e4dc9246f4612b73fca9b9d842287e44.tar.bz2
slixmpp-a4ec7413e4dc9246f4612b73fca9b9d842287e44.tar.xz
slixmpp-a4ec7413e4dc9246f4612b73fca9b9d842287e44.zip
fixed 2.6 compatibility for componentxmpp
Diffstat (limited to '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):