Skip to content
Snippets Groups Projects
Commit ddb8d20b authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

basestring makes the isinstance checks work.

parent 349c0051
Branches
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment