Merge pull request #3584 from jwodder/fix-3583
Fix encoding error with `print` statements in doctests
This commit is contained in:
@@ -505,7 +505,7 @@ def _fix_spoof_python2(runner, encoding):
|
||||
|
||||
def getvalue(self):
|
||||
result = _SpoofOut.getvalue(self)
|
||||
if encoding:
|
||||
if encoding and isinstance(result, bytes):
|
||||
result = result.decode(encoding)
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user