Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e98209c

Browse files
Issue #24245: Eliminated senseless expect clauses that have no any effect.
Patch by Martin Panter.
1 parent ba9ac5b commit e98209c

5 files changed

Lines changed: 0 additions & 14 deletions

File tree

Lib/distutils/core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ def run_setup (script_name, script_args=None, stop_after="run"):
221221
# Hmm, should we do something if exiting with a non-zero code
222222
# (ie. error)?
223223
pass
224-
except:
225-
raise
226224

227225
if _setup_distribution is None:
228226
raise RuntimeError(("'distutils.core.setup()' was never called -- "

Lib/test/regrtest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,6 @@ def work():
765765
except KeyboardInterrupt:
766766
interrupted = True
767767
break
768-
except:
769-
raise
770768
if ns.findleaks:
771769
gc.collect()
772770
if gc.garbage:
@@ -823,8 +821,6 @@ def work():
823821
# print a newline separate from the ^C
824822
print()
825823
break
826-
except:
827-
raise
828824

829825
if ns.single:
830826
if next_single_test:

Lib/test/test_urllib2net.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def _retry_thrice(func, exc, *args, **kwargs):
2020
except exc as e:
2121
last_exc = e
2222
continue
23-
except:
24-
raise
2523
raise last_exc
2624

2725
def _wrap_with_retry_thrice(func, exc):

Lib/tkinter/font.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ def __del__(self):
112112
try:
113113
if self.delete_font:
114114
self._call("font", "delete", self.name)
115-
except (KeyboardInterrupt, SystemExit):
116-
raise
117115
except Exception:
118116
pass
119117

Lib/unittest/test/support.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ def test_hash(self):
2525
try:
2626
if not hash(obj_1) == hash(obj_2):
2727
self.fail("%r and %r do not hash equal" % (obj_1, obj_2))
28-
except KeyboardInterrupt:
29-
raise
3028
except Exception as e:
3129
self.fail("Problem hashing %r and %r: %s" % (obj_1, obj_2, e))
3230

@@ -35,8 +33,6 @@ def test_hash(self):
3533
if hash(obj_1) == hash(obj_2):
3634
self.fail("%s and %s hash equal, but shouldn't" %
3735
(obj_1, obj_2))
38-
except KeyboardInterrupt:
39-
raise
4036
except Exception as e:
4137
self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))
4238

0 commit comments

Comments
 (0)