On Jun 9, 2:22 pm, mrstevegross <mrstevegr...@gmail.com> wrote: > I'm trying to write a try/catch block to handle an "interrupted system > call". However, I can't seem to locate information on the actual > typename of the exception. Does anyone know what it would be? I want > my code to look like this: > > try: > ... > except InterruptedSystemCall # what's the right name? > ... > > Thanks, > --Steve
You'll get that error when an async. event (signal) is delivered to your application during a system call. It's a result of 'errno' being set to errno.EINTR (4). I check for a few such specific conditions in some of my code and I usually do it like so: try: .... except EnvironmentError, e: if e.errno == errno.EINTR: do_something_with_eintr_error() else: raise That works for me. There isn't an "InterruptedSystemCall" error or equivalent in the standard exception hierarchy. EnvironmentError is the parent of OSError & IOError, which is where you'll most likely be encountering that state. Thanks, Jeff mcjeff.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list