diff options
Diffstat (limited to 'slixmpp/xmlstream')
-rw-r--r-- | slixmpp/xmlstream/tostring.py | 12 | ||||
-rw-r--r-- | slixmpp/xmlstream/xmlstream.py | 22 |
2 files changed, 3 insertions, 31 deletions
diff --git a/slixmpp/xmlstream/tostring.py b/slixmpp/xmlstream/tostring.py index c1e4911a..2d99e323 100644 --- a/slixmpp/xmlstream/tostring.py +++ b/slixmpp/xmlstream/tostring.py @@ -13,14 +13,6 @@ :license: MIT, see LICENSE for more details """ -from __future__ import unicode_literals - -import sys - -if sys.version_info < (3, 0): - import types - - XML_NS = 'http://www.w3.org/XML/1998/namespace' @@ -145,10 +137,6 @@ def escape(text, use_cdata=False): :param string text: The XML text to convert. :rtype: Unicode string """ - if sys.version_info < (3, 0): - if type(text) != types.UnicodeType: - text = unicode(text, 'utf-8', 'ignore') - escapes = {'&': '&', '<': '<', '>': '>', diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 13e88428..92f5c6d3 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -12,32 +12,19 @@ :license: MIT, see LICENSE for more details """ -from __future__ import with_statement, unicode_literals - import asyncio import functools -import base64 import copy import logging -import signal import socket as Socket import ssl -import sys -import time -import random import weakref import uuid -import errno -from xml.parsers.expat import ExpatError import xml.etree.ElementTree -import slixmpp -from slixmpp.util import Queue, QueueEmpty, safedict -from slixmpp.xmlstream import tostring, cert -from slixmpp.xmlstream.stanzabase import StanzaBase, ET, ElementBase -from slixmpp.xmlstream.handler import Waiter, XMLCallback -from slixmpp.xmlstream.matcher import MatchXMLMask +from slixmpp.xmlstream import tostring +from slixmpp.xmlstream.stanzabase import StanzaBase, ElementBase from slixmpp.xmlstream.resolver import resolve, default_resolver #: The time in seconds to wait before timing out waiting for response stanzas. @@ -584,10 +571,7 @@ class XMLStream(object): if not self.dns_answers: self.dns_answers = self.get_dns_records(domain, port) - if sys.version_info < (3, 0): - return self.dns_answers.next() - else: - return next(self.dns_answers) + return next(self.dns_answers) def add_event_handler(self, name, pointer, disposable=False): """Add a custom event handler that will be executed whenever |