From db0c5b786df961785ae8c803f5572ae0c8dadcc7 Mon Sep 17 00:00:00 2001 From: "M. Kocher" Date: Wed, 28 Apr 2021 01:16:38 -0700 Subject: bpo-43776: Remove list call from args in Popen repr (GH-25338) Removes the `list` call in the Popen `repr`. Current implementation: For cmd = `python --version`, with `shell=True`. ```bash ``` For `shell=False` and args=`['python', '--version']`, the output is correct: ```bash ``` With the new changes the `repr` yields: For cmd = `python --version`, with `shell=True`: ```bash ``` For `shell=False` and args=`['python', '--version']`, the output: ```bash ``` Automerge-Triggered-By: GH:gpshead --- Lib/subprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/subprocess.py') diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 2b785496e4..8203aded7d 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1003,7 +1003,7 @@ class Popen: def __repr__(self): obj_repr = ( f"<{self.__class__.__name__}: " - f"returncode: {self.returncode} args: {list(self.args)!r}>" + f"returncode: {self.returncode} args: {self.args!r}>" ) if len(obj_repr) > 80: obj_repr = obj_repr[:76] + "...>" -- cgit v1.2.1