Advertisement
Tiran

zmq + subprocess CLOEXEC test

Jun 19th, 2012
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import zmq
  2. import sys
  3. import os
  4. import subprocess
  5.  
  6. context = zmq.Context()
  7.  
  8. print "parent", len(os.listdir("/proc/%i/fd" % os.getpid()))
  9.  
  10. print subprocess.check_output(
  11.     [sys.executable, "-c",
  12.      """import os; print "child", len(os.listdir("/proc/%i/fd" % os.getpid()))"""])
  13.  
  14. # output:
  15. # parent 15
  16. # child 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement