mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
bpo-38724: Implement subprocess.Popen.__repr__ (GH-17151)
This commit is contained in:
parent
143a97f641
commit
645005e947
3 changed files with 34 additions and 0 deletions
|
@ -978,6 +978,15 @@ class Popen(object):
|
|||
|
||||
raise
|
||||
|
||||
def __repr__(self):
|
||||
obj_repr = (
|
||||
f"<{self.__class__.__name__}: "
|
||||
f"returncode: {self.returncode} args: {list(self.args)!r}>"
|
||||
)
|
||||
if len(obj_repr) > 80:
|
||||
obj_repr = obj_repr[:76] + "...>"
|
||||
return obj_repr
|
||||
|
||||
@property
|
||||
def universal_newlines(self):
|
||||
# universal_newlines as retained as an alias of text_mode for API
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue