summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-01-08 18:41:40 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-01-08 18:41:40 (GMT)
commit3ddc435af6873c6304058d7bcbcb19ee4fba7781 (patch)
treec7a03cf0a8b856bae2ebebba55b09f775845c7ca /Lib/test/test_socket.py
parent3194d1454cbc11ec477d83fff3fc749972107d29 (diff)
downloadcpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.zip
cpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.tar.gz
cpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.tar.bz2
Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. Patch by flox
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index faa06c5..b4f37eb 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -123,7 +123,7 @@ class ThreadableTest:
self.server_ready.wait()
self.client_ready.set()
self.clientSetUp()
- if not callable(test_func):
+ if not hasattr(test_func, '__call__'):
raise TypeError, "test_func must be a callable function"
try:
test_func()
@@ -282,7 +282,7 @@ class GeneralModuleTests(unittest.TestCase):
orig = sys.getrefcount(__name__)
socket.getnameinfo(__name__,0)
except TypeError:
- if sys.getrefcount(__name__) <> orig:
+ if sys.getrefcount(__name__) != orig:
self.fail("socket.getnameinfo loses a reference")
def testInterpreterCrash(self):
@@ -1234,7 +1234,9 @@ class BufferIOTest(SocketConnectedTest):
self.assertEqual(msg, MSG)
def _testRecvInto(self):
- buf = buffer(MSG)
+ # Silence Py3k warning
+ with test_support.check_warnings():
+ buf = buffer(MSG)
self.serv_conn.send(buf)
def testRecvFromInto(self):
@@ -1245,7 +1247,9 @@ class BufferIOTest(SocketConnectedTest):
self.assertEqual(msg, MSG)
def _testRecvFromInto(self):
- buf = buffer(MSG)
+ # Silence Py3k warning
+ with test_support.check_warnings():
+ buf = buffer(MSG)
self.serv_conn.send(buf)