cros_build_lib: _Popen: workaround Python 3.4.1+ subprocess locking bug

Python 3.4.1 changed behavior where Popen APIs cannot be used from a
signal handler when the Popen object was in use when the signal was
delivered due to holding a threading lock.  Add some internal helpers
to workaround it.

See the upstream bug report for more details:

TEST=CQ passes

Change-Id: I76d71351cde8061bd6b50ec4512209e09bbf543d
Reviewed-by: Chris McDonald <>
Commit-Queue: Mike Frysinger <>
Tested-by: Mike Frysinger <>
Reviewed-by: Mike Frysinger <>
1 file changed