assert self.__initialized, "Thread.__init__() not called"
According to the official docs:
"If the subclass overrides the constructor, it must make sure to
invoke the base class constructor (Thread.__init__()) before doing
anything else to the thread."
http://docs.python.org/library/threa...thread-objects
So, change your __init__ to this:
class myThread (threading.Thread):
def __init__(self, threadID, name, q):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.q = q
According to the official docs:
"If the subclass overrides the constructor, it must make sure to
invoke the base class constructor (Thread.__init__()) before doing
anything else to the thread."
http://docs.python.org/library/threa...thread-objects
So, change your __init__ to this:
class myThread (threading.Thread):
def __init__(self, threadID, name, q):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.q = q
Comments
Post a Comment
https://gengwg.blogspot.com/