From 6627e360d7b5795abe0b248bd4529a0693cbcc13 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Mon, 16 Feb 2015 14:23:46 -0500 Subject: [PATCH] Fix python3 ReferenceError --- README.md | 2 ++ socketIO_client/__init__.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b587fb8..ef3b3ed 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/invisibleroads/socketIO-client.svg?branch=master)](https://travis-ci.org/invisibleroads/socketIO-client) + socketIO-client =============== Here is a [socket.io](http://socket.io) client library for Python. You can use it to write test code for your socket.io server. diff --git a/socketIO_client/__init__.py b/socketIO_client/__init__.py index 3624484..f06b5cb 100644 --- a/socketIO_client/__init__.py +++ b/socketIO_client/__init__.py @@ -289,7 +289,10 @@ class SocketIO(object): self.wait(seconds, for_callbacks=True) def disconnect(self, path=''): - self._transport.disconnect(path) + try: + self._transport.disconnect(path) + except ReferenceError: + pass try: namespace = self._namespace_by_path[path] namespace.on_disconnect()