socketIO-client-2 icon indicating copy to clipboard operation
socketIO-client-2 copied to clipboard

TypeError in predicate function

Open oeway opened this issue 6 years ago • 0 comments

Hi, thanks for your work, I encountered a problem when using this library (in Python 3), this is the error message:

File "......../socketIO_client/parsers.py", line 48, in traverse
if predicate(obj):
File "......../socketIO_client/parsers.py", line 39, in predicate
return '_placeholder' in obj and 'num' in obj
TypeError: argument of type 'int' is not iterable

I was able to fix by replace predicate with:

    def predicate(obj):
            if type(obj) is dict:
                return '_placeholder' in obj and 'num' in obj
            else:
                return False

I think it would be great to include this change in your repo, thanks.

oeway avatar Sep 24 '18 18:09 oeway