I have to run run_me() skip print("spam") and os._exit() in order to print ("shouldn't happen") and run main() and print ("I ran")
import os
>>> def run_me():
... print("spam")
... os._exit(1)
... print("shouldn't happen")
...
>>> def main():
... exit = os._exit
... os._exit = lambda status: None
... run_me()
... os._exit = exit
... print("I ran")
>>> main()
spam
shouldn't happen
I am just having a hard time figuring out how to skip the first print line and os._exit so I can get win() to run.
import os
>>> def run_me():
... print("spam")
... os._exit(1)
... print("shouldn't happen")
...
>>> def main():
... exit = os._exit
... os._exit = lambda status: None
... run_me()
... os._exit = exit
... print("I ran")
>>> main()
spam
shouldn't happen
I am just having a hard time figuring out how to skip the first print line and os._exit so I can get win() to run.