Skip to content

Commit 0acf268

Browse files
committed
Simplify ps1/ps2 handling
1 parent faa65fc commit 0acf268

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

bpython/repl.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -459,18 +459,12 @@ def __init__(self, interp, config):
459459
)
460460

461461
@property
462-
def ps1(self):
463-
try:
464-
return sys.ps1
465-
except AttributeError:
466-
return ">>> "
462+
def ps1(self) -> str:
463+
return getattr(sys, "ps1", ">>> ")
467464

468465
@property
469-
def ps2(self):
470-
try:
471-
return sys.ps2
472-
except AttributeError:
473-
return "... "
466+
def ps2(self) -> str:
467+
return getattr(sys, "ps2", "... ")
474468

475469
def startup(self):
476470
"""

0 commit comments

Comments
 (0)