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.

overlapping_exceptions.py 844B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # pylint: disable=missing-docstring
  2. class SomeException(Exception):
  3. pass
  4. class SubclassException(SomeException):
  5. pass
  6. AliasException = SomeException
  7. try:
  8. pass
  9. except (SomeException, SomeException): # [overlapping-except]
  10. pass
  11. try:
  12. pass
  13. except (SomeException, SubclassException): # [overlapping-except]
  14. pass
  15. try:
  16. pass
  17. except (SomeException, AliasException): # [overlapping-except]
  18. pass
  19. try:
  20. pass
  21. except (AliasException, SubclassException): # [overlapping-except]
  22. pass
  23. try:
  24. pass
  25. # +1:[overlapping-except, overlapping-except, overlapping-except]
  26. except (SomeException, AliasException, SubclassException):
  27. pass
  28. try:
  29. pass
  30. except (ArithmeticError, FloatingPointError): # [overlapping-except]
  31. pass
  32. try:
  33. pass
  34. except (ValueError, UnicodeDecodeError): # [overlapping-except]
  35. pass