mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
Merge pull request #798 from scopatz/fix_deadlock
Fix deadlock on windows
This commit is contained in:
commit
65cffc4e18
2 changed files with 7 additions and 1 deletions
|
@ -56,6 +56,8 @@ Current Developments
|
|||
* Fixed environment variables from os.environ not beeing loaded when a running
|
||||
a script
|
||||
* Fixed bug that prevented `source-alias` from working.
|
||||
* Fixed deadlock on Windows when runing subprocess that generates enough output
|
||||
to fill the OS pipe buffer
|
||||
|
||||
**Security:** None
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import time
|
|||
import signal
|
||||
import builtins
|
||||
from subprocess import TimeoutExpired
|
||||
from io import BytesIO
|
||||
|
||||
from xonsh.tools import ON_WINDOWS
|
||||
|
||||
|
@ -41,13 +42,16 @@ if ON_WINDOWS:
|
|||
return
|
||||
while obj.returncode is None:
|
||||
try:
|
||||
obj.wait(0.01)
|
||||
outs, errs = obj.communicate(timeout=0.01)
|
||||
except TimeoutExpired:
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
obj.kill()
|
||||
outs, errs = obj.communicate()
|
||||
if obj.poll() is not None:
|
||||
builtins.__xonsh_active_job__ = None
|
||||
obj.stdout = BytesIO(outs)
|
||||
obj.stderr = BytesIO(errs)
|
||||
|
||||
else:
|
||||
def _continue(obj):
|
||||
|
|
Loading…
Add table
Reference in a new issue