Kaydet (Commit) e98209c2 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #24245: Eliminated senseless expect clauses that have no any effect.

Patch by Martin Panter.
üst ba9ac5b5
...@@ -221,8 +221,6 @@ def run_setup (script_name, script_args=None, stop_after="run"): ...@@ -221,8 +221,6 @@ def run_setup (script_name, script_args=None, stop_after="run"):
# Hmm, should we do something if exiting with a non-zero code # Hmm, should we do something if exiting with a non-zero code
# (ie. error)? # (ie. error)?
pass pass
except:
raise
if _setup_distribution is None: if _setup_distribution is None:
raise RuntimeError(("'distutils.core.setup()' was never called -- " raise RuntimeError(("'distutils.core.setup()' was never called -- "
......
...@@ -765,8 +765,6 @@ def main(tests=None, **kwargs): ...@@ -765,8 +765,6 @@ def main(tests=None, **kwargs):
except KeyboardInterrupt: except KeyboardInterrupt:
interrupted = True interrupted = True
break break
except:
raise
if ns.findleaks: if ns.findleaks:
gc.collect() gc.collect()
if gc.garbage: if gc.garbage:
...@@ -823,8 +821,6 @@ def main(tests=None, **kwargs): ...@@ -823,8 +821,6 @@ def main(tests=None, **kwargs):
# print a newline separate from the ^C # print a newline separate from the ^C
print() print()
break break
except:
raise
if ns.single: if ns.single:
if next_single_test: if next_single_test:
......
...@@ -20,8 +20,6 @@ def _retry_thrice(func, exc, *args, **kwargs): ...@@ -20,8 +20,6 @@ def _retry_thrice(func, exc, *args, **kwargs):
except exc as e: except exc as e:
last_exc = e last_exc = e
continue continue
except:
raise
raise last_exc raise last_exc
def _wrap_with_retry_thrice(func, exc): def _wrap_with_retry_thrice(func, exc):
......
...@@ -112,8 +112,6 @@ class Font: ...@@ -112,8 +112,6 @@ class Font:
try: try:
if self.delete_font: if self.delete_font:
self._call("font", "delete", self.name) self._call("font", "delete", self.name)
except (KeyboardInterrupt, SystemExit):
raise
except Exception: except Exception:
pass pass
......
...@@ -25,8 +25,6 @@ class TestHashing(object): ...@@ -25,8 +25,6 @@ class TestHashing(object):
try: try:
if not hash(obj_1) == hash(obj_2): if not hash(obj_1) == hash(obj_2):
self.fail("%r and %r do not hash equal" % (obj_1, obj_2)) self.fail("%r and %r do not hash equal" % (obj_1, obj_2))
except KeyboardInterrupt:
raise
except Exception as e: except Exception as e:
self.fail("Problem hashing %r and %r: %s" % (obj_1, obj_2, e)) self.fail("Problem hashing %r and %r: %s" % (obj_1, obj_2, e))
...@@ -35,8 +33,6 @@ class TestHashing(object): ...@@ -35,8 +33,6 @@ class TestHashing(object):
if hash(obj_1) == hash(obj_2): if hash(obj_1) == hash(obj_2):
self.fail("%s and %s hash equal, but shouldn't" % self.fail("%s and %s hash equal, but shouldn't" %
(obj_1, obj_2)) (obj_1, obj_2))
except KeyboardInterrupt:
raise
except Exception as e: except Exception as e:
self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e)) self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment