On 28.05.2013 19:25, sparkle Plenty wrote:
I need to catch and handle 10057 exceptions when they occur and keep
running.  I know 10057 is a WinError, which is a subset of OSError, I
just can't find the right syntax for it.  I would appreciate some
help on this one.

I have neither Windows nor Python3.3 to test but according to the docs, "winerror" is an attribute of the OSError exception ( http://docs.python.org/3/library/exceptions.html?highlight=oserror#OSError ). Thus something like

try:
   # some code
except OSError as e:
   if e.winerror == 10057:
      # do error handling
   else:
      raise # re-raise any other error

should work.

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

Reply via email to