executable in python3
dirty modification to allow execution in python3 as well.
This commit is contained in:
parent
65aacf15e3
commit
8676286100
@ -1,5 +1,8 @@
|
||||
import websocket
|
||||
try:
|
||||
import thread
|
||||
except ImportError: #TODO use Threading instead of _thread in python3
|
||||
import _thread
|
||||
import time
|
||||
import sys
|
||||
|
||||
@ -29,7 +32,11 @@ def on_open(ws):
|
||||
ws.close()
|
||||
print("Thread terminating...")
|
||||
|
||||
try:
|
||||
thread.start_new_thread(run, ())
|
||||
except:
|
||||
_thread.start_new_thread(run, ())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
websocket.enableTrace(True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user