From: Eric S. Raymond Date: Sat, 6 Oct 2012 08:49:00 +0000 (-0400) Subject: basestring makes the isinstance checks work. X-Git-Tag: 1.8~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ddb8d20b2f3a86240ae8fe50d1d2176985745cca;p=irker.git basestring makes the isinstance checks work. --- diff --git a/irkerd b/irkerd index 76cda61..34fb33a 100755 --- a/irkerd +++ b/irkerd @@ -428,15 +428,15 @@ class Irker: else: channels = request['to'] message = request['privmsg'] - if type(channels) not in (type([]), type(""), type(u"")): + if not isinstance(channels, (list, basestring)): self.logerr("malformed request - unexpected channel type: %r" % channels) - if type(message) not in (type(""), type(u"")): + if not isinstance(message, basestring): self.logerr("malformed request - unexpected message type: %r" % message) else: - if type(channels) != type([]): + if not isinstance(channels, list): channels = [channels] for url in channels: - if not type(url) in (type(""), type(u"")): + if not isinstance(url, basestring): self.logerr("malformed request - URL has unexpected type: %r" % url) else: target = Target(url)