Skip to content

Commit 9542b0c

Browse files
committed
Properly encode source
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 64772c0 commit 9542b0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/repl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def runsource(self, source, filename='<input>', symbol='single',
108108
encode=True):
109109
with self.timer:
110110
if encode:
111-
source = '# coding: %s\n%s' % (
112-
self.encoding, source.encode(self.encoding))
111+
source = u'# coding: %s\n%s' % (self.encoding, source)
112+
source = source.encode(self.encoding)
113113
return code.InteractiveInterpreter.runsource(self, source,
114114
filename, symbol)
115115

0 commit comments

Comments
 (0)