X Tutup
Skip to content

Commit 5a021f8

Browse files
committed
Turn ps1 and ps2 into unicode
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 7e4b9d4 commit 5a021f8

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

bpython/repl.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,23 @@ def __init__(self, interp, config):
388388
@property
389389
def ps1(self):
390390
try:
391-
return str(sys.ps1)
391+
if not py3:
392+
return sys.ps1.decode(getpreferredencoding())
393+
else:
394+
return sys.ps1
392395
except AttributeError:
393-
return '>>> '
396+
return u'>>> '
394397

395398
@property
396399
def ps2(self):
397400
try:
398-
return str(sys.ps2)
401+
if not py3:
402+
return sys.ps2.decode(getpreferredencoding())
403+
else:
404+
return sys.ps2
405+
399406
except AttributeError:
400-
return '... '
407+
return u'... '
401408

402409
def startup(self):
403410
"""

0 commit comments

Comments
 (0)
X Tutup