[meld] Clean up bare exceptions
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Clean up bare exceptions
- Date: Sun, 31 Dec 2017 20:13:05 +0000 (UTC)
commit beaf245ced0f628133ec29300fa39a29a5c124bf
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 17 06:25:50 2017 +1000
Clean up bare exceptions
All of these cases do actually mean to catch everything, but they still
shouldn't be bare excepts.
meld/meldapp.py | 2 +-
meld/vc/_vc.py | 2 +-
meld/vcview.py | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 8027c8a3..5706cfc1 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -207,7 +207,7 @@ class MeldApp(Gtk.Application):
try:
self.command_line.do_print_literal(
self.command_line, self.output.getvalue())
- except:
+ except Exception:
print(self.output.getvalue())
self.exit_status = status
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index 90aa98ec..e57a2ea3 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -334,7 +334,7 @@ class Vc(object):
try:
call([cls.CMD])
return True
- except:
+ except Exception:
return False
@classmethod
diff --git a/meld/vcview.py b/meld/vcview.py
index d33d36ce..239bc358 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -60,7 +60,7 @@ def cleanup_temp():
if os.name == "nt":
os.chmod(f, stat.S_IWRITE)
os.remove(f)
- except:
+ except Exception:
except_str = "{0[0]}: \"{0[1]}\"".format(sys.exc_info())
print("File \"{0}\" not removed due to".format(f), except_str,
file=sys.stderr)
@@ -69,7 +69,7 @@ def cleanup_temp():
assert (os.path.exists(f) and os.path.isabs(f) and
os.path.dirname(f) == temp_location)
shutil.rmtree(f, ignore_errors=1)
- except:
+ except Exception:
except_str = "{0[0]}: \"{0[1]}\"".format(sys.exc_info())
print("Directory \"{0}\" not removed due to".format(f), except_str,
file=sys.stderr)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]