[Python-checkins] cpython (merge 3.2 -> default): Fix flakiness in test_socketserver

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


http://hg.python.org/cpython/rev/12984b151204
changeset: 76170:12984b151204
parent: 76166:97a0c6230ece
parent: 76169:4f5b44de5c37
user: Antoine Pitrou <solipsis at pitrou.net>
date: Mon Apr 09 01:18:07 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 によって変換されたページ (->オリジナル) /