0002-except-statement-changed-slightly-in-2-6.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 2af95cff5609142ec14efdf13b394f9b0121ab2e Mon Sep 17 00:00:00 2001
  2. From: mmbutter <mario.butter@gmail.com>
  3. Date: Thu, 11 Jun 2020 15:50:03 -0500
  4. Subject: [PATCH] except statement changed slightly in 2.6. This could cause
  5. problems in newer versions. Updated to the new format.
  6. [Retrieved from:
  7. https://github.com/whilp/cli/commit/2af95cff5609142ec14efdf13b394f9b0121ab2e]
  8. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  9. ---
  10. lib/cli/app.py | 10 +++++-----
  11. 1 file changed, 5 insertions(+), 5 deletions(-)
  12. diff --git a/lib/cli/app.py b/lib/cli/app.py
  13. index f487ab4..45256b8 100644
  14. --- a/lib/cli/app.py
  15. +++ b/lib/cli/app.py
  16. @@ -239,10 +239,10 @@ def run(self):
  17. args = ()
  18. try:
  19. returned = self.main(*args)
  20. - except Exception, e:
  21. - elif isinstance(e, self.reraise):
  22. - # raising the last exception preserves traceback
  23. - raise
  24. + except self.reraise:
  25. + # raising the last exception preserves traceback
  26. + raise
  27. + except Exception as e:
  28. returned = e
  29. return self.post_run(returned)
  30. @@ -420,7 +420,7 @@ def pre_run(self):
  31. """
  32. try:
  33. ns = self.argparser.parse_args()
  34. - except SystemExit, e:
  35. + except SystemExit as e:
  36. if self.exit_after_main:
  37. raise
  38. else: