[Python-checkins] cpython (2.7): Fix flakiness in test_socketserver

antoine.pitrou python-checkins at python.org
Mon Apr 9 01:23:44 CEST 2012


http://hg.python.org/cpython/rev/463fd270c5de
changeset: 76168:463fd270c5de
branch: 2.7
user: Antoine Pitrou <solipsis at pitrou.net>
date: Mon Apr 09 01:15:06 2012 +0200
summary:
 Fix flakiness in test_socketserver
files:
 Lib/test/test_socketserver.py | 5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -34,8 +34,11 @@
 if hasattr(signal, 'alarm'):
 signal.alarm(n)
 
+# Remember real select() to avoid interferences with mocking
+_real_select = select.select
+
 def receive(sock, n, timeout=20):
- r, w, x = select.select([sock], [], [], timeout)
+ r, w, x = _real_select([sock], [], [], timeout)
 if sock in r:
 return sock.recv(n)
 else:
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /