Skip to content

Instantly share code, notes, and snippets.

@jleedev
Created July 29, 2010 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jleedev/497243 to your computer and use it in GitHub Desktop.
Save jleedev/497243 to your computer and use it in GitHub Desktop.
Screwing with subprocess
from signal import *
from subprocess import *
Popen(['true']).communicate()
signal(SIGCHLD, SIG_IGN)
Popen(['true']).communicate()
Traceback (most recent call last):
File "test.py", line 8, in <module>
Popen(['true']).communicate()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 668, in communicate
self.wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1137, in wait
pid, sts = os.waitpid(self.pid, 0)
OSError: [Errno 10] No child processes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment