bpo-16500: Don't use string constants for os.register_at_fork() behavior (#1834)

Instead use keyword only arguments to os.register_at_fork for each of the scenarios.
Updates the documentation for clarity.
This commit is contained in:
Gregory P. Smith 2017-05-29 10:03:41 -07:00 committed by GitHub
parent eba68e2c42
commit 163468a766
8 changed files with 128 additions and 75 deletions

View file

@ -1359,5 +1359,5 @@ def _after_fork():
assert len(_active) == 1
if hasattr(_os, "fork"):
_os.register_at_fork(_after_fork, when="child")
if hasattr(_os, "register_at_fork"):
_os.register_at_fork(after_in_child=_after_fork)