Andrew added the comment:

pppery, I don't think I am breaking gc functionality with my code. The code 
line I gave just meant to give the basic idea of what was helping to workaround 
this. If you are actually interested in the code I use, it is below:

def fix_subprocess_racecondition():
  """
  !!! PLEASE NOTE THIS SHOULD BE CALLED BEFORE ANY OTHER INITIALIZATION was 
done to avoid already created links to subprocess or subprocess.gc or gc
  """
  # monkey patching subprocess
  import subprocess
  subprocess.gc.isenabled = lambda: True

  # re-importing gc to have correct isenabled for non-subprocess contexts
  import sys
  del sys.modules['gc']
  import gc

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27448>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to