Skip to content

Commit 60fb6eb

Browse files
committed
Merged in _petronius/bpython (pull request #32)
Fix for issue #267
2 parents 485e427 + 1b52d97 commit 60fb6eb

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

bpython/repl.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,6 @@ def __init__(self, interp, config):
388388
self._C = {}
389389
self.prev_block_finished = 0
390390
self.interact = Interaction(self.config)
391-
self.ps1 = '>>> '
392-
self.ps2 = '... '
393391
# previous pastebin content to prevent duplicate pastes, filled on call
394392
# to repl.pastebin
395393
self.prev_pastebin_content = ''
@@ -403,6 +401,20 @@ def __init__(self, interp, config):
403401
self.rl_history.load(pythonhist,
404402
getpreferredencoding() or "ascii")
405403

404+
@property
405+
def ps1(self):
406+
try:
407+
return str(sys.ps1)
408+
except AttributeError:
409+
return '>>> '
410+
411+
@property
412+
def ps2(self):
413+
try:
414+
return str(sys.ps2)
415+
except AttributeError:
416+
return '... '
417+
406418
def startup(self):
407419
"""
408420
Execute PYTHONSTARTUP file if it exits. Call this after front

0 commit comments

Comments
 (0)