Skip to content

Commit 92593f8

Browse files
authored
Merge pull request #57 from zowe/fix-56
Update pyzowe.py
2 parents 62549e6 + 548a21e commit 92593f8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/pyzowe/pyzowe.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"""
2525
import subprocess
2626
import json
27+
import os
2728

2829

2930
class ZoweCallError(Exception):
@@ -82,13 +83,14 @@ def zowe(arguments: str):
8283
for job in zowe("zos-jobs list jobs"):
8384
print(f"Job {job['jobid']} has return code {job['retcode']}")
8485
"""
85-
8686
zowe_command = "zowe " + arguments + " --rfj"
87+
8788
try:
89+
temp_env = os.environ.copy()
90+
temp_env['FORCE_COLOR'] = "0"
8891
completed_process = subprocess.run(
89-
zowe_command, shell=True, capture_output=True, check=True, encoding="utf8")
92+
zowe_command, shell=True, capture_output=True, check=True, encoding="utf8", env=temp_env)
9093
parsed_output = json.loads(completed_process.stdout)
9194
return parsed_output.get("data", parsed_output)
9295
except subprocess.CalledProcessError as e:
93-
raise ZoweCallError(e.returncode, e.cmd, arguments,
94-
output=e.output, stderr=e.stderr)
96+
raise ZoweCallError(e.returncode, e.cmd, arguments, output=e.output, stderr=e.stderr)

0 commit comments

Comments
 (0)