[Python-checkins] cpython (merge 3.5 -> 3.6): Merge 3.5 (issue #28613)

yury.selivanov python-checkins at python.org
Mon Nov 7 19:01:32 EST 2016


https://hg.python.org/cpython/rev/61a237f3bb07
changeset:   104964:61a237f3bb07
branch:      3.6
parent:      104961:d903a243c281
parent:      104963:abad0b9a35b3
user:        Yury Selivanov <yury at magic.io>
date:        Mon Nov 07 19:01:14 2016 -0500
summary:
  Merge 3.5 (issue #28613)

files:
  Lib/asyncio/events.py                |  1 +
  Lib/test/test_asyncio/test_events.py |  4 ++++
  2 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -6,6 +6,7 @@
            'get_event_loop_policy', 'set_event_loop_policy',
            'get_event_loop', 'set_event_loop', 'new_event_loop',
            'get_child_watcher', 'set_child_watcher',
+           '_set_running_loop', '_get_running_loop',
            ]
 
 import functools
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -2732,9 +2732,11 @@
         try:
             asyncio.set_event_loop_policy(Policy())
             loop = asyncio.new_event_loop()
+            self.assertIs(asyncio._get_running_loop(), None)
 
             async def func():
                 self.assertIs(asyncio.get_event_loop(), loop)
+                self.assertIs(asyncio._get_running_loop(), loop)
 
             loop.run_until_complete(func())
         finally:
@@ -2742,6 +2744,8 @@
             if loop is not None:
                 loop.close()
 
+        self.assertIs(asyncio._get_running_loop(), None)
+
 
 if __name__ == '__main__':
     unittest.main()

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list