Fix for getUserInfo method throwing an error

The participants property on thread object is return a list of unicodes. If you then pass these unicodes to getUserInfo, they are not being picked up in the if statement on line 905 in the fbidStrip method, so the fbidStrip method was returning a tuple of None objects. The conditional now matches and reformats both str and unicode objects.
This commit is contained in:
Tom McAdam
2017-05-05 17:03:21 +09:00
committed by GitHub
parent 5019671b35
commit dc1d158059

View File

@@ -902,7 +902,7 @@ class Client(object):
if type(_fbid) == int: if type(_fbid) == int:
return _fbid return _fbid
if type(_fbid) == str and 'fbid:' in _fbid: if type(_fbid) in [str, unicode] and 'fbid:' in _fbid:
return int(_fbid[5:]) return int(_fbid[5:])
user_ids = [fbidStrip(uid) for uid in user_ids] user_ids = [fbidStrip(uid) for uid in user_ids]