summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/events.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-05-30 00:56:33 (GMT)
committerGitHub <noreply@github.com>2018-05-30 00:56:33 (GMT)
commitaf9cda9845666e2f704177a431d29f91efbf828a (patch)
treeecd1b22e6e1a7dad91c5065bfb71ae9dec2bbef5 /Lib/asyncio/events.py
parent3ddee64587482082fcbab930ff82ed67aa9f4a0d (diff)
downloadcpython-af9cda9845666e2f704177a431d29f91efbf828a.zip
cpython-af9cda9845666e2f704177a431d29f91efbf828a.tar.gz
cpython-af9cda9845666e2f704177a431d29f91efbf828a.tar.bz2
Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (GH-7233)
This reverts commit 2a7eb0b531656f4a77d85078e6e009e4b3639ef9.
Diffstat (limited to 'Lib/asyncio/events.py')
-rw-r--r--Lib/asyncio/events.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 68dc25e..40946bb 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -625,23 +625,16 @@ class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
class _Local(threading.local):
_loop = None
- _pid = None
_set_called = False
def __init__(self):
self._local = self._Local()
- self._local._pid = os.getpid()
def get_event_loop(self):
"""Get the event loop.
This may be None or an instance of EventLoop.
"""
- if self._local._pid != os.getpid():
- # If we detect we're in a child process forked by multiprocessing,
- # we reset self._local so that we'll get a new event loop.
- self._local = self._Local()
-
if (self._local._loop is None and
not self._local._set_called and
isinstance(threading.current_thread(), threading._MainThread)):