From 859822ff05c0c19cc16965918ef1d76eb8e531cb Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 19 Mar 2012 14:24:45 -0700 Subject: Fix unicode issues in test cases for Py3+ introduced by issue #150. --- sleekxmpp/plugins/xep_0009/binding.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/plugins/xep_0009/binding.py b/sleekxmpp/plugins/xep_0009/binding.py index 5418626b..a55993ad 100644 --- a/sleekxmpp/plugins/xep_0009/binding.py +++ b/sleekxmpp/plugins/xep_0009/binding.py @@ -10,6 +10,10 @@ from sleekxmpp.xmlstream import ET import base64 import logging import time +import sys + +if sys.version_info > (3, 0): + unicode = str log = logging.getLogger(__name__) @@ -152,7 +156,7 @@ class rpctime(object): def __init__(self,data=None): #assume string data is in iso format YYYYMMDDTHH:MM:SS - if type(data) is str: + if type(data) in (str, unicode): 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