summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorGiampaolo RodolĂ  <g.rodola@gmail.com>2010-05-06 18:37:34 (GMT)
committerGiampaolo RodolĂ  <g.rodola@gmail.com>2010-05-06 18:37:34 (GMT)
commitc2f1dca62de8c1c5377b5323e49685fc6a0396ff (patch)
tree81000dfa58250c2c3205e0e17131245809cc7bfe /Lib/test/test_asyncore.py
parent452a580848642d235375b9957ba4c7cceb5b0a5b (diff)
downloadcpython-c2f1dca62de8c1c5377b5323e49685fc6a0396ff.zip
cpython-c2f1dca62de8c1c5377b5323e49685fc6a0396ff.tar.gz
cpython-c2f1dca62de8c1c5377b5323e49685fc6a0396ff.tar.bz2
Merged revisions 80876 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80876 | giampaolo.rodola | 2010-05-06 20:06:30 +0200 (gio, 06 mag 2010) | 9 lines Merged revisions 80875 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80875 | giampaolo.rodola | 2010-05-06 19:57:06 +0200 (gio, 06 mag 2010) | 1 line Fix asyncore issues 8573 and 8483: _strerror might throw ValueError; asyncore.__getattr__ cheap inheritance caused confusing error messages when accessing undefined class attributes; added an alias for __str__ which now is used as a fallback for __repr__ ........ ................
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r--Lib/test/test_asyncore.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index ba89f12..4db29ca 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -302,6 +302,18 @@ class DispatcherTests(unittest.TestCase):
'warning: unhandled accept event']
self.assertEquals(lines, expected)
+ def test_issue_8594(self):
+ d = asyncore.dispatcher(socket.socket())
+ # make sure the error message no longer refers to the socket
+ # object but the dispatcher instance instead
+ try:
+ d.foo
+ except AttributeError as err:
+ self.assertTrue('dispatcher instance' in str(err))
+ else:
+ self.fail("exception not raised")
+ # test cheap inheritance with the underlying socket
+ self.assertEqual(d.family, socket.AF_INET)
class dispatcherwithsend_noread(asyncore.dispatcher_with_send):