Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Fix command line quoting for Windows (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed May 26, 2020
1 parent 6ba8cbc commit 4ec70db
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions codecov/__init__.py
Expand Up @@ -27,10 +27,22 @@
except ImportError: # pragma: no cover
from urllib import urlencode

try:
from shlex import quote
except ImportError: # pragma: no cover
from pipes import quote
quote = None
if sys.platform == 'win32': # pragma: no cover
try:
# https://github.com/python/cpython/blob/3.7/Lib/subprocess.py#L174-L175
from subprocess import list2cmdline

def quote(arg):
return list2cmdline([arg])
except ImportError:
pass

if quote is None:
try:
from shlex import quote
except ImportError: # pragma: no cover
from pipes import quote

import subprocess

Expand Down

0 comments on commit 4ec70db

Please sign in to comment.