diff options
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/demo/ss1.py | 8 | ||||
-rwxr-xr-x | Tools/scripts/eptags.py | 2 | ||||
-rw-r--r-- | Tools/unicode/gencodec.py | 2 |
3 files changed, 6 insertions, 6 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) diff --git a/Tools/scripts/eptags.py b/Tools/scripts/eptags.py index 671ff11..401ac7e 100755 --- a/Tools/scripts/eptags.py +++ b/Tools/scripts/eptags.py @@ -25,7 +25,7 @@ def treat_file(filename, outfp): """Append tags found in file named 'filename' to the open file 'outfp'""" try: fp = open(filename, 'r') - except: + except OSError: sys.stderr.write('Cannot open %s\n'%filename) return charno = 0 diff --git a/Tools/unicode/gencodec.py b/Tools/unicode/gencodec.py index 98b3975..4c21469 100644 --- a/Tools/unicode/gencodec.py +++ b/Tools/unicode/gencodec.py @@ -127,7 +127,7 @@ def hexrepr(t, precision=4): return 'None' try: len(t) - except: + except TypeError: return '0x%0*X' % (precision, t) try: return '(' + ', '.join(['0x%0*X' % (precision, item) |