From 768136e493916826187db9a7dbc4a3502b26c1bc Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 9 Jun 2014 08:28:57 -0700 Subject: Fix things again, this time for python3 --- sleekxmpp/xmlstream/xmlstream.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sleekxmpp/xmlstream/xmlstream.py') diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index c5c9fe38..66985f3d 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -31,7 +31,7 @@ import errno from xml.parsers.expat import ExpatError import sleekxmpp -from sleekxmpp.util import Queue, QueueEmpty +from sleekxmpp.util import Queue, QueueEmpty, safedict from sleekxmpp.thirdparty.statemachine import StateMachine from sleekxmpp.xmlstream import Scheduler, tostring, cert from sleekxmpp.xmlstream.stanzabase import StanzaBase, ET, ElementBase @@ -518,13 +518,13 @@ class XMLStream(object): else: cert_policy = ssl.CERT_REQUIRED - ssl_args = { - b'certfile': self.certfile, - b'keyfile': self.keyfile, - b'ca_certs': self.ca_certs, - b'cert_reqs': cert_policy, - b'do_handshake_on_connect': False, - } + ssl_args = safedict({ + 'certfile': self.certfile, + 'keyfile': self.keyfile, + 'ca_certs': self.ca_certs, + 'cert_reqs': cert_policy, + 'do_handshake_on_connect': False + }) if sys.version_info >= (2, 7): ssl_args['ciphers'] = self.ciphers @@ -842,13 +842,13 @@ class XMLStream(object): else: cert_policy = ssl.CERT_REQUIRED - ssl_args = { - b'certfile': self.certfile, - b'keyfile': self.keyfile, - b'ca_certs': self.ca_certs, - b'cert_reqs': cert_policy, - b'do_handshake_on_connect': False, - } + ssl_args = safedict({ + 'certfile': self.certfile, + 'keyfile': self.keyfile, + 'ca_certs': self.ca_certs, + 'cert_reqs': cert_policy, + 'do_handshake_on_connect': False + }) if sys.version_info >= (2, 7): ssl_args['ciphers'] = self.ciphers -- cgit v1.2.3