Made it compatible with gevent 1.0dev version.

This commit is contained in:
linkerlin 2013-06-28 22:26:31 +08:00
parent 284b3a24f7
commit 80e5adad8c

View File

@ -2875,14 +2875,16 @@ class myTableWidgetItem(QTableWidgetItem):
def __lt__(self, other):
return int(self.data(33).toPyObject()) < int(other.data(33).toPyObject())
class UISignaler(QThread):
from threading import Thread
class UISignaler(Thread,QThread):
def __init__(self, parent=None):
Thread.__init__(self, parent)
QThread.__init__(self, parent)
def run(self):
while True:
try:
command, data = shared.UISignalQueue.get()
if command == 'writeNewAddressToTable':
label, address, streamNumber = data
@ -2927,6 +2929,14 @@ class UISignaler(QThread):
else:
sys.stderr.write(
'Command sent to UISignaler not recognized: %s\n' % command)
except Exception,ex:
# uncaught exception will block gevent
import traceback
traceback.print_exc()
traceback.print_stack()
print ex
pass
try:
import gevent
except ImportError as ex: