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/plugins/xep_0009/binding.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'slixmpp/plugins/xep_0009') diff --git a/slixmpp/plugins/xep_0009/binding.py b/slixmpp/plugins/xep_0009/binding.py index 5416fc41..d922dfc7 100644 --- a/slixmpp/plugins/xep_0009/binding.py +++ b/slixmpp/plugins/xep_0009/binding.py @@ -10,10 +10,6 @@ from slixmpp.xmlstream import ET import base64 import logging import time -import sys - -if sys.version_info > (3, 0): - unicode = str log = logging.getLogger(__name__) @@ -58,7 +54,7 @@ def _py2xml(*args): boolean = ET.Element("{%s}boolean" % _namespace) boolean.text = str(int(x)) val.append(boolean) - elif type(x) in (str, unicode): + elif type(x) is str: string = ET.Element("{%s}string" % _namespace) string.text = x val.append(string) @@ -156,7 +152,7 @@ class rpctime(object): def __init__(self,data=None): #assume string data is in iso format YYYYMMDDTHH:MM:SS - if type(data) in (str, unicode): + if type(data) is str: self.timestamp = time.strptime(data,"%Y%m%dT%H:%M:%S") elif type(data) is time.struct_time: self.timestamp = data -- cgit v1.2.3