From 0e950154103ba9385b13f76548befa87509995f3 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 16 Aug 2014 22:37:25 +0200 Subject: Remove sys.version_info checks for python2 and clean some imports. --- slixmpp/xmlstream/xmlstream.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'slixmpp/xmlstream/xmlstream.py') 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 -- cgit v1.2.3