Skip to content

Commit 3a1c1b0

Browse files
committed
Fix Python 3 compatibility
1 parent a3179a9 commit 3a1c1b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/simplerepl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def request_undo(self, n=1):
6464

6565
def out(self, msg):
6666
if hasattr(self, "orig_stdout"):
67-
self.orig_stdout.write((msg + "\n").encode("utf8"))
67+
self.orig_stdout.write(f"{msg}\n")
6868
self.orig_stdout.flush()
6969
else:
7070
print(msg)
@@ -89,7 +89,7 @@ def print_padded(s):
8989
print_padded("")
9090
self.out("X``" + ("`" * (self.width + 2)) + "``X")
9191
for line in arr:
92-
self.out("X```" + unicode(line.ljust(self.width)) + "```X")
92+
self.out("X```" + line.ljust(self.width) + "```X")
9393
logger.debug("line:")
9494
logger.debug(repr(line))
9595
self.out("X``" + ("`" * (self.width + 2)) + "``X")

0 commit comments

Comments
 (0)