mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
Merge pull request #1908 from xonsh/fix_spspec_repr
Fix SubprocSpec repr
This commit is contained in:
commit
63232fe664
2 changed files with 16 additions and 2 deletions
14
news/fix_spspec_repr.rst
Normal file
14
news/fix_spspec_repr.rst
Normal file
|
@ -0,0 +1,14 @@
|
|||
**Added:** None
|
||||
|
||||
**Changed:** None
|
||||
|
||||
**Deprecated:** None
|
||||
|
||||
**Removed:** None
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Fix ``__repr__`` and ``__str__`` methods of ``SubprocSpec`` so they report
|
||||
correctly
|
||||
|
||||
**Security:** None
|
|
@ -426,13 +426,13 @@ class SubprocSpec:
|
|||
self.captured_stderr = None
|
||||
|
||||
def __str__(self):
|
||||
s = self.cls.__name__ + '(' + str(cmd) + ', '
|
||||
s = self.cls.__name__ + '(' + str(self.cmd) + ', '
|
||||
kws = [n + '=' + str(getattr(self, n)) for n in self.kwnames]
|
||||
s += ', '.join(kws) + ')'
|
||||
return s
|
||||
|
||||
def __repr__(self):
|
||||
s = self.__class__.__name__ + '(' + repr(cmd) + ', '
|
||||
s = self.__class__.__name__ + '(' + repr(self.cmd) + ', '
|
||||
s += self.cls.__name__ + ', '
|
||||
kws = [n + '=' + repr(getattr(self, n)) for n in self.kwnames]
|
||||
s += ', '.join(kws) + ')'
|
||||
|
|
Loading…
Add table
Reference in a new issue