Last active
January 30, 2020 20:02
-
-
Save schipiga/143751d133a4624157d88dfe66706b17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from multiprocessing import Process | |
def target(): | |
raise Exception('BOOM!') | |
def main(): | |
proc = Process(target=target) | |
proc.start() | |
time.sleep(1) | |
print('Is process alive?', proc.is_alive()) | |
proc._popen.returncode = None # reset cached exit code | |
print('Is process alive?', proc.is_alive()) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment