[#3583] Fix encoding error with `print` statements in doctests
This fix was suggested by Stack Overflow user phd in <https://stackoverflow.com/a/50863820/744178>.
This commit is contained in:
parent
5221a14764
commit
d382f3e77f
|
@ -0,0 +1 @@
|
||||||
|
Fix encoding error with `print` statements in doctests
|
|
@ -505,7 +505,7 @@ def _fix_spoof_python2(runner, encoding):
|
||||||
|
|
||||||
def getvalue(self):
|
def getvalue(self):
|
||||||
result = _SpoofOut.getvalue(self)
|
result = _SpoofOut.getvalue(self)
|
||||||
if encoding:
|
if encoding and isinstance(result, bytes):
|
||||||
result = result.decode(encoding)
|
result = result.decode(encoding)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue