]> granicus.if.org Git - python/commitdiff
Fix the patch for issue #7978: select() raises select.error before 3.3, not OSError.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Apr 2012 23:37:19 +0000 (01:37 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Apr 2012 23:37:19 +0000 (01:37 +0200)
Lib/socketserver.py
Lib/test/test_socketserver.py

index c8a8db1950eee26043445438e7dec8678a382bb6..adf9f38ead8f23d54bce7cbb3da14090f3594cc0 100644 (file)
@@ -153,8 +153,8 @@ def _eintr_retry(func, *args):
     while True:
         try:
             return func(*args)
-        except OSError as e:
-            if e.errno != errno.EINTR:
+        except (OSError, select.error) as e:
+            if e.args[0] != errno.EINTR:
                 raise
 
 class BaseServer:
index 353f8ff3d4d2940967d38612303b8dd26d297727..ca23301cd1f89e4ed5e3e7dad00c401a0c7aaf55 100644 (file)
@@ -244,7 +244,7 @@ class SocketServerTest(unittest.TestCase):
                 self.called += 1
                 if self.called == 1:
                     # raise the exception on first call
-                    raise OSError(errno.EINTR, os.strerror(errno.EINTR))
+                    raise select.error(errno.EINTR, os.strerror(errno.EINTR))
                 else:
                     # Return real select value for consecutive calls
                     return old_select(*args)