修复okcoin接口无法关闭的bug

This commit is contained in:
chenxy123 2016-11-21 06:29:05 +08:00
parent 9e789af8b8
commit 4d80596462
2 changed files with 2 additions and 2 deletions

View File

@ -169,7 +169,7 @@ class OkCoinApi(object):
#----------------------------------------------------------------------
def close(self):
"""关闭接口"""
if self.thread.isAlive:
if self.thread and self.thread.isAlive:
self.ws.close()
self.thread.join()

View File

@ -169,7 +169,7 @@ class OkCoinApi(object):
#----------------------------------------------------------------------
def close(self):
"""关闭接口"""
if self.thread.isAlive:
if self.thread and self.thread.isAlive:
self.ws.close()
self.thread.join()