upgrading delegator.py to resolve PYTHONUNBUFFERED issue in shell

This commit is contained in:
Nate Prewitt
2017-07-21 08:22:57 -06:00
parent 06acad1a75
commit 61d3fcdb36
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
flake8 = ">=3.3.0,<4"
pytest = "*"
mock = "*"
"delegator.py" = ">=0.0.12"
"delegator.py" = ">=0.0.13"
toml = "*"
Sphinx = "<=1.5.5"
+3 -4
View File
@@ -5,9 +5,6 @@ import signal
from pexpect.popen_spawn import PopenSpawn
# Enable Python subprocesses to work with expect functionality.
os.environ['PYTHONUNBUFFERED'] = '1'
# Include `unicode` in STR_TYPES for Python 2.X
try:
STR_TYPES = (str, unicode)
@@ -147,6 +144,8 @@ class Command(object):
pexpect_kwargs = self._default_pexpect_kwargs.copy()
if binary:
pexpect_kwargs['encoding'] = None
# Enable Python subprocesses to work with expect functionality.
pexpect_kwargs['env']['PYTHONUNBUFFERED'] = '1'
s = PopenSpawn(self._popen_args, **pexpect_kwargs)
self.subprocess = s
self.was_run = True
@@ -260,4 +259,4 @@ def run(command, block=True, binary=False, timeout=TIMEOUT):
if block:
c.block()
return c
return c