diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-20 07:33:40 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-20 07:33:40 (GMT) |
commit | ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23 (patch) | |
tree | 84491ee8c5be973ab45551b7319bb71416946827 /Tools/demo | |
parent | 492f0277933fd5714762a99ec99fd7f97d99866a (diff) | |
download | cpython-ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23.zip cpython-ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23.tar.gz cpython-ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23.tar.bz2 |
Issue #16261: Converted some bare except statements to except statements
with specified exception type. Original patch by Ramchandra Apte.
Diffstat (limited to 'Tools/demo')
-rwxr-xr-x | Tools/demo/ss1.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/demo/ss1.py b/Tools/demo/ss1.py index 649790f..c51f041 100755 --- a/Tools/demo/ss1.py +++ b/Tools/demo/ss1.py @@ -261,7 +261,7 @@ class SheetParser: def end_int(self, text): try: self.value = int(text) - except: + except (TypeError, ValueError): self.value = None end_long = end_int @@ -269,13 +269,13 @@ class SheetParser: def end_double(self, text): try: self.value = float(text) - except: + except (TypeError, ValueError): self.value = None def end_complex(self, text): try: self.value = complex(text) - except: + except (TypeError, ValueError): self.value = None def end_string(self, text): @@ -763,7 +763,7 @@ class SheetGUI: for cls in int, float, complex: try: value = cls(text) - except: + except (TypeError, ValueError): continue else: cell = NumericCell(value) |