Skip to content

TypeError in predicate function #17

Description

@oeway

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions