summaryrefslogtreecommitdiff
path: root/slixmpp/componentxmpp.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-08-16 22:37:25 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-09-01 02:42:45 +0200
commit0e950154103ba9385b13f76548befa87509995f3 (patch)
tree14f38018f0ca25deed5729c7f4c9fd84779e5655 /slixmpp/componentxmpp.py
parentb92dac72f3bb601837dde507597d47715c5ad1aa (diff)
downloadslixmpp-0e950154103ba9385b13f76548befa87509995f3.tar.gz
slixmpp-0e950154103ba9385b13f76548befa87509995f3.tar.bz2
slixmpp-0e950154103ba9385b13f76548befa87509995f3.tar.xz
slixmpp-0e950154103ba9385b13f76548befa87509995f3.zip
Remove sys.version_info checks for python2 and clean some imports.
Diffstat (limited to 'slixmpp/componentxmpp.py')
-rw-r--r--slixmpp/componentxmpp.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/slixmpp/componentxmpp.py b/slixmpp/componentxmpp.py
index 52829dfa..b00e084e 100644
--- a/slixmpp/componentxmpp.py
+++ b/slixmpp/componentxmpp.py
@@ -12,10 +12,7 @@
:license: MIT, see LICENSE for more details
"""
-from __future__ import absolute_import
-
import logging
-import sys
import hashlib
from slixmpp.basexmpp import BaseXMPP
@@ -136,10 +133,7 @@ class ComponentXMPP(BaseXMPP):
# Construct a hash of the stream ID and the component secret.
sid = xml.get('id', '')
- pre_hash = '%s%s' % (sid, self.secret)
- if sys.version_info >= (3, 0):
- # Handle Unicode byte encoding in Python 3.
- pre_hash = bytes(pre_hash, 'utf-8')
+ pre_hash = bytes('%s%s' % (sid, self.secret), 'utf-8')
handshake = ET.Element('{jabber:component:accept}handshake')
handshake.text = hashlib.sha1(pre_hash).hexdigest().lower()