Skip to content

Commit 885dc34

Browse files
authored
Bug fix for core not working in python 3 (#62)
1 parent bc454b7 commit 885dc34

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/core/src/bootstrap/EnvLayer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,18 @@ def __run_command_output_raw(self, cmd, no_output, chk_err=True):
9696
Reports exceptions to Error if chk_err parameter is True
9797
"""
9898

99-
def check_output(no_output, *popenargs, **kwargs):
99+
def check_output(*popenargs, **kwargs):
100100
"""
101101
Backport from subprocess module from python 2.7
102102
"""
103103
if 'stdout' in kwargs:
104104
raise ValueError('stdout argument not allowed, it will be overridden.')
105+
106+
no_output = False
107+
if type(popenargs[0]) is bool:
108+
no_output = popenargs[0]
109+
popenargs = popenargs[1:]
110+
105111
if no_output is True:
106112
out_file = None
107113
else:

src/core/src/local_loggers/StdOutFileMirror.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
If the log file language is set to 'Python' in Notepad++, with code as implemented below, useful collapsibility is obtained."""
1919
import sys
2020

21+
2122
class StdOutFileMirror(object):
2223
"""Mirrors all terminal output to a local file"""
2324

src/extension/src/ProcessHandler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,18 @@ def __run_command_output_raw(self, cmd, no_output, chk_err=True):
114114
Reports exceptions to Error if chk_err parameter is True
115115
"""
116116

117-
def check_output(no_output, *popenargs, **kwargs):
117+
def check_output(*popenargs, **kwargs):
118118
"""
119119
Backport from subprocess module from python 2.7
120120
"""
121121
if 'stdout' in kwargs:
122122
raise ValueError('stdout argument not allowed, it will be overridden.')
123+
124+
no_output = False
125+
if type(popenargs[0]) is bool:
126+
no_output = popenargs[0]
127+
popenargs = popenargs[1:]
128+
123129
if no_output is True:
124130
out_file = None
125131
else:

0 commit comments

Comments
 (0)