MCPcopy Create free account
hub / github.com/bpython/bpython / _process_ps

Function _process_ps

bpython/curtsiesfrontend/repl.py:300–305  ·  view source on GitHub ↗

Replace ps1/ps2 with the default if the user specified value contains control characters.

(ps, default_ps: str)

Source from the content-addressed store, hash-verified

298
299
300def _process_ps(ps, default_ps: str):
301 """Replace ps1/ps2 with the default if the user specified value contains control characters."""
302 if not isinstance(ps, str):
303 return ps
304
305 return ps if wcswidth(ps) >= 0 else default_ps
306
307
308class BaseRepl(Repl):

Callers 2

ps1Method · 0.85
ps2Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected