Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 39331a6

Browse files
authored
Run Python coverage tool with shell=False
1 parent 8660351 commit 39331a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

codecov/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def check_output(cmd, **popen_args):
177177
return output.decode('utf-8')
178178

179179

180-
def try_to_run(cmd):
180+
def try_to_run(cmd, shell=True):
181181
try:
182-
return check_output(cmd, shell=True)
182+
return check_output(cmd, shell=shell)
183183
except subprocess.CalledProcessError as e:
184184
write(' Error running `%s`: %s' % (cmd, str(getattr(e, 'output', str(e)))))
185185

@@ -193,10 +193,10 @@ def run_python_coverage(args):
193193
import coverage
194194
except ImportError:
195195
# Coverage is not installed on this Python. Hope it's on PATH.
196-
try_to_run(['coverage'] + args)
196+
try_to_run(['coverage'] + args, shell=False)
197197
else:
198198
# Coverage is installed on this Python. Run it as a module.
199-
try_to_run([sys.executable, '-m', 'coverage'] + args)
199+
try_to_run([sys.executable, '-m', 'coverage'] + args, shell=False)
200200

201201
def remove_non_ascii(data):
202202
try:

0 commit comments

Comments
 (0)