]> granicus.if.org Git - python/commitdiff
Fix for failing asyncore tests.
authorJosiah Carlson <josiah.carlson@gmail.com>
Wed, 1 Apr 2009 01:28:11 +0000 (01:28 +0000)
committerJosiah Carlson <josiah.carlson@gmail.com>
Wed, 1 Apr 2009 01:28:11 +0000 (01:28 +0000)
Doc/library/asyncore.rst
Lib/asyncore.py
Lib/test/test_asyncore.py

index 4736a9c11108554a8c00d2cb52b7cc01c88c1321..a2e1b5ed73ab111516c09190ebf225b4326193be 100644 (file)
@@ -81,7 +81,8 @@ any that have been added to the map during asynchronous service) is closed.
    +----------------------+----------------------------------------+
    | Event                | Description                            |
    +======================+========================================+
-   | ``handle_connect()`` | Implied by the first write event       |
+   | ``handle_connect()`` | Implied by the first read or write     |
+   |                      | event                                  |
    +----------------------+----------------------------------------+
    | ``handle_close()``   | Implied by a read event with no data   |
    |                      | available                              |
index 07b0499fd143522683e0ecbbe5edb823d0abc299..4f1153b760b68db056917f39859379fbaa643e69 100644 (file)
@@ -401,7 +401,7 @@ class dispatcher:
         sys.stderr.write('log: %s\n' % str(message))
 
     def log_info(self, message, type='info'):
-        if __debug__ or type not in self.ignore_log_types:
+        if type not in self.ignore_log_types:
             print '%s: %s' % (type, message)
 
     def handle_read_event(self):
index 72de850f1de20a2fee0994d227580c4111ceaa68..13b39e121901fbf9177175128672396cb522542c 100644 (file)
@@ -298,6 +298,7 @@ class DispatcherTests(unittest.TestCase):
 
     def test_unhandled(self):
         d = asyncore.dispatcher()
+        d.ignore_log_types = ()
 
         # capture output of dispatcher.log_info() (to stdout via print)
         fp = StringIO()
@@ -313,7 +314,7 @@ class DispatcherTests(unittest.TestCase):
             sys.stdout = stdout
 
         lines = fp.getvalue().splitlines()
-        expected = ['warning: unhandled exception',
+        expected = ['warning: unhandled incoming priority event',
                     'warning: unhandled read event',
                     'warning: unhandled write event',
                     'warning: unhandled connect event',