Merge pull request #1908 from xonsh/fix_spspec_repr

Fix SubprocSpec repr
This commit is contained in:
Konstantinos Tsakiltzidis 2016-10-28 02:43:05 +03:00 committed by GitHub
commit 63232fe664
2 changed files with 16 additions and 2 deletions

14
news/fix_spspec_repr.rst Normal file
View 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

View file

@ -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) + ')'