Merge pull request #1427 from mxr/minor-typing-fixes

Update type hint and expression for _multiprocessing_is_fork()
This commit is contained in:
Anthony Sottile 2021-10-17 18:58:55 -07:00 committed by GitHub
commit 4157cdbc6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,9 +40,11 @@ SERIAL_RETRY_ERRNOS = {
}
def _multiprocessing_is_fork(): # type () -> bool
def _multiprocessing_is_fork() -> bool:
"""Class state is only preserved when using the `fork` strategy."""
return multiprocessing and multiprocessing.get_start_method() == "fork"
return bool(
multiprocessing and multiprocessing.get_start_method() == "fork"
)
class Manager: