]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #24245: Eliminated senseless expect clauses that have no any effect in
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 20 May 2015 13:15:02 +0000 (16:15 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 20 May 2015 13:15:02 +0000 (16:15 +0300)
IDLE.  Patch by Martin Panter.

Lib/idlelib/idle.pyw
Lib/idlelib/rpc.py

index 0db5fd426e7b9ccdf59929de641a5d33d9d9e6e3..142cb322ac24934919a37451469803acf6ad6788 100644 (file)
@@ -2,20 +2,16 @@ try:
     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()
index f2aae516c837d60567e5281bc2a4ecf52f883a61..aa33041e7b3edb1148848138471ed5ba2c04f069 100644 (file)
@@ -340,10 +340,7 @@ class SocketIO(object):
                 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