From ddb8d20b2f3a86240ae8fe50d1d2176985745cca Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 6 Oct 2012 04:49:00 -0400 Subject: [PATCH] basestring makes the isinstance checks work. --- irkerd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) -- 2.26.2