Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5bd9cdd

Browse files
add comments
1 parentaefab6b commit5bd9cdd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎Lib/asyncio/events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ def __init__(self):
668668
self._local=self._Local()
669669
ifhasattr(os,'fork'):
670670
defon_fork():
671+
# Reset the loop and wakeupfd in the forked child process.
671672
self._local=self._Local()
672673
signal.set_wakeup_fd(-1)
673674

‎Lib/test/test_asyncio/test_unix_events.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,8 @@ async def runner():
18731873
@unittest.skipUnless(hasattr(os,'fork'),'requires os.fork()')
18741874
classTestFork(unittest.IsolatedAsyncioTestCase):
18751875

1876-
asyncdeftest_fork(self):
1876+
asyncdeftest_fork_not_share_event_loop(self):
1877+
# The forked process should not share the event loop with the parent
18771878
loop=asyncio.get_running_loop()
18781879
r,w=os.pipe()
18791880
self.addCleanup(os.close,r)
@@ -1893,6 +1894,8 @@ async def test_fork(self):
18931894
wait_process(pid,exitcode=0)
18941895

18951896
deftest_fork_signal_handling(self):
1897+
# Sending signals to the forked process should not affect the parent
1898+
# process.
18961899
multiprocessing.set_start_method('fork')
18971900
manager=multiprocessing.Manager()
18981901
self.addCleanup(manager.shutdown)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp