summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-05-30 00:47:56 (GMT)
committerGitHub <noreply@github.com>2018-05-30 00:47:56 (GMT)
commit99279ad823a758288e4e41962abfc4dad8943ce8 (patch)
treef5f6c3dca3e98850adf7aac9a8fe88ba50042640 /Lib/asyncio
parentdec947ca26bd598a26869226dcac592a7ccf0d56 (diff)
downloadcpython-99279ad823a758288e4e41962abfc4dad8943ce8.zip
cpython-99279ad823a758288e4e41962abfc4dad8943ce8.tar.gz
cpython-99279ad823a758288e4e41962abfc4dad8943ce8.tar.bz2
Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (#7232)
This reverts commit 5d97b7bcc19496617bf8c448d2f149cc28c73bc7.
Diffstat (limited to 'Lib/asyncio')
-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)):