Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def handle_timeout():
  2. ... important cleanup logic ...
  3.  
  4. signal.signal(signal.SIGALRM, handle_timeout) # <-- why no TypeError here?
  5. signal.alarm(MY_APPLICATION_TIME_LIMIT)
  6.  
  7. ... do stuff and then if we take too long ...
  8.  
  9. # py2: TypeError: handle_timeout() takes no arguments
  10. # py3: TypeError: handle_timeout() takes 0 positional arguments but 2 were given
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement