Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

unpacked_exceptions.py 501B

1234567891011
  1. """Test for redefine-in-handler, overwriting names in exception handlers."""
  2. def new_style():
  3. """Some exceptions can be unpacked."""
  4. try:
  5. pass
  6. except IOError, (errno, message): # [unpacking-in-except]
  7. print errno, message # pylint: disable=print-statement
  8. # +1: [redefine-in-handler,redefine-in-handler,unpacking-in-except]
  9. except IOError, (new_style, tuple): # pylint: disable=duplicate-except
  10. print new_style, tuple # pylint: disable=print-statement