# HG changeset patch # Parent 1134198e23bd4a11a74995e8dc7a7651cfd37c06 diff -r 1134198e23bd -r 3fc46c640bf2 Lib/distutils/core.py --- a/Lib/distutils/core.py Wed May 20 00:14:00 2015 +0300 +++ b/Lib/distutils/core.py Wed May 20 03:07:17 2015 +0000 @@ -221,8 +221,6 @@ # Hmm, should we do something if exiting with a non-zero code # (ie. error)? pass - except: - raise if _setup_distribution is None: raise RuntimeError(("'distutils.core.setup()' was never called -- " diff -r 1134198e23bd -r 3fc46c640bf2 Lib/idlelib/idle.pyw --- a/Lib/idlelib/idle.pyw Wed May 20 00:14:00 2015 +0300 +++ b/Lib/idlelib/idle.pyw Wed May 20 03:07:17 2015 +0000 @@ -2,20 +2,16 @@ import idlelib.PyShell except ImportError: # IDLE is not installed, but maybe PyShell is on sys.path: - try: - from . import PyShell - except ImportError: - raise - else: - import os - idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) - if idledir != os.getcwd(): - # We're not in the IDLE directory, help the subprocess find run.py - pypath = os.environ.get('PYTHONPATH', '') - if pypath: - os.environ['PYTHONPATH'] = pypath + ':' + idledir - else: - os.environ['PYTHONPATH'] = idledir - PyShell.main() + from . import PyShell + import os + idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) + if idledir != os.getcwd(): + # We're not in the IDLE directory, help the subprocess find run.py + pypath = os.environ.get('PYTHONPATH', '') + if pypath: + os.environ['PYTHONPATH'] = pypath + ':' + idledir + else: + os.environ['PYTHONPATH'] = idledir + PyShell.main() else: idlelib.PyShell.main() diff -r 1134198e23bd -r 3fc46c640bf2 Lib/idlelib/rpc.py --- a/Lib/idlelib/rpc.py Wed May 20 00:14:00 2015 +0300 +++ b/Lib/idlelib/rpc.py Wed May 20 03:07:17 2015 +0000 @@ -340,10 +340,7 @@ n = self.sock.send(s[:BUFSIZE]) except (AttributeError, TypeError): raise OSError("socket no longer exists") - except OSError: - raise - else: - s = s[n:] + s = s[n:] buff = b'' bufneed = 4 diff -r 1134198e23bd -r 3fc46c640bf2 Lib/test/regrtest.py --- a/Lib/test/regrtest.py Wed May 20 00:14:00 2015 +0300 +++ b/Lib/test/regrtest.py Wed May 20 03:07:17 2015 +0000 @@ -765,8 +765,6 @@ except KeyboardInterrupt: interrupted = True break - except: - raise if ns.findleaks: gc.collect() if gc.garbage: @@ -823,8 +821,6 @@ # print a newline separate from the ^C print() break - except: - raise if ns.single: if next_single_test: diff -r 1134198e23bd -r 3fc46c640bf2 Lib/test/test_queue.py --- a/Lib/test/test_queue.py Wed May 20 00:14:00 2015 +0300 +++ b/Lib/test/test_queue.py Wed May 20 03:07:17 2015 +0000 @@ -69,13 +69,9 @@ self.t = _TriggerThread(trigger_func, trigger_args) self.t.start() try: - try: - block_func(*block_args) - except expected_exception_class: - raise - else: - self.fail("expected exception of kind %r" % - expected_exception_class) + block_func(*block_args) + self.fail("expected exception of kind %r" % + expected_exception_class) finally: self.t.join(10) # make sure the thread terminates if self.t.is_alive(): diff -r 1134198e23bd -r 3fc46c640bf2 Lib/test/test_urllib2net.py --- a/Lib/test/test_urllib2net.py Wed May 20 00:14:00 2015 +0300 +++ b/Lib/test/test_urllib2net.py Wed May 20 03:07:17 2015 +0000 @@ -20,8 +20,6 @@ except exc as e: last_exc = e continue - except: - raise raise last_exc def _wrap_with_retry_thrice(func, exc): diff -r 1134198e23bd -r 3fc46c640bf2 Lib/tkinter/font.py --- a/Lib/tkinter/font.py Wed May 20 00:14:00 2015 +0300 +++ b/Lib/tkinter/font.py Wed May 20 03:07:17 2015 +0000 @@ -112,8 +112,6 @@ try: if self.delete_font: self._call("font", "delete", self.name) - except (KeyboardInterrupt, SystemExit): - raise except Exception: pass diff -r 1134198e23bd -r 3fc46c640bf2 Lib/unittest/test/support.py --- a/Lib/unittest/test/support.py Wed May 20 00:14:00 2015 +0300 +++ b/Lib/unittest/test/support.py Wed May 20 03:07:17 2015 +0000 @@ -25,8 +25,6 @@ try: if not hash(obj_1) == hash(obj_2): self.fail("%r and %r do not hash equal" % (obj_1, obj_2)) - except KeyboardInterrupt: - raise except Exception as e: self.fail("Problem hashing %r and %r: %s" % (obj_1, obj_2, e)) @@ -35,8 +33,6 @@ if hash(obj_1) == hash(obj_2): self.fail("%s and %s hash equal, but shouldn't" % (obj_1, obj_2)) - except KeyboardInterrupt: - raise except Exception as e: self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))