Skip to content

Commit

Permalink
Try to fix error at Windows + Python 2.7 environment
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Jan 22, 2017
1 parent a8ecedc commit 262a975
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions subprocrunner/_subprocess_runner.py
Expand Up @@ -77,9 +77,16 @@ def run(self):
return 0

self.__logging_debug(self.command)
proc = subprocess.Popen(
self.command, shell=True, env=self.__get_env(),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)

try:
proc = subprocess.Popen(
self.command, shell=True, env=self.__get_env(),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except TypeError:
proc = subprocess.Popen(
self.command, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)

self.__stdout, self.__stderr = proc.communicate()
self.__returncode = proc.returncode

Expand Down Expand Up @@ -108,9 +115,15 @@ def popen(self, std_in=None, environ=None):
return None

self.__logging_debug(self.command)
process = subprocess.Popen(
self.command, env=self.__get_env(environ), shell=True,
stdin=std_in, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

try:
process = subprocess.Popen(
self.command, env=self.__get_env(environ), shell=True,
stdin=std_in, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except TypeError:
process = subprocess.Popen(
self.command, shell=True,
stdin=std_in, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

return process

Expand Down

0 comments on commit 262a975

Please sign in to comment.