"somnath chakrabarti" <chakrabarti.somn...@gmail.com> wrote

Below is the code that I have written to do the timeout implementation. But I am getting error as follows. Can anybody please help me where I am going
wrong?

I have no idea how this framework is upposed to work but my
guess is that the problem lies here:

   def getSolution(self,solver):
       Problem.setSolver(self,solver)
       self.p = threading.Timer(100, self.onTimeout())

Thios looks like you should be providing a callback
function self.onTimeout but you are calling the function
instead of referencing it. This calls the method before
self.p has been defined.

You need to remove the parentheses after Timeout.

I think...

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to