Skip to content

Commit

Permalink
Unbreak Python 2.7, as per usual
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Sep 25, 2019
1 parent 277233f commit 4374386
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import print_function

import codecs
import doctest
import locale
Expand Down Expand Up @@ -893,7 +895,10 @@ def _run(self, *command):
stdout, stderr = p.communicate()
rc = p.wait()
if stdout:
print(stdout.decode('ascii', 'backslashreplace'))
print(
stdout if isinstance(stdout, str) else
stdout.decode('ascii', 'backslashreplace')
)
if rc:
raise subprocess.CalledProcessError(rc, command[0], output=stdout)

Expand Down

0 comments on commit 4374386

Please sign in to comment.