diff options
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 2723bc9e42..93635ee61f 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1097,12 +1097,7 @@ class Popen(object): assert not pass_fds, "pass_fds not supported on Windows." if not isinstance(args, str): - try: - args = os.fsdecode(args) # os.PathLike -> str - except TypeError: # not an os.PathLike, must be a sequence. - args = list(args) - args[0] = os.fsdecode(args[0]) # os.PathLike -> str - args = list2cmdline(args) + args = list2cmdline(args) # Process startup details if startupinfo is None: @@ -1374,10 +1369,7 @@ class Popen(object): if isinstance(args, (str, bytes)): args = [args] else: - try: - args = list(args) - except TypeError: # os.PathLike instead of a sequence? - args = [os.fsencode(args)] # os.PathLike -> [str] + args = list(args) if shell: # On Android the default shell is at '/system/bin/sh'. |