From 61d3fcdb362fb8bdbd51f3c1c8f417c3280fc5f8 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Fri, 21 Jul 2017 08:22:57 -0600 Subject: [PATCH] upgrading delegator.py to resolve PYTHONUNBUFFERED issue in shell --- Pipfile | 2 +- pipenv/vendor/delegator.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index a342feb6..f2e71fb5 100644 --- a/Pipfile +++ b/Pipfile @@ -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" diff --git a/pipenv/vendor/delegator.py b/pipenv/vendor/delegator.py index 491eb794..e61413bc 100644 --- a/pipenv/vendor/delegator.py +++ b/pipenv/vendor/delegator.py @@ -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 \ No newline at end of file + return c