From 3f02d344ddcbe0b0452074c70812fa2e2704a365 Mon Sep 17 00:00:00 2001 From: Martinez Date: Sat, 13 Jan 2018 00:06:41 +0100 Subject: [PATCH] fix python color prompt in bpython-0.17 --- lib/python-startup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python-startup.py b/lib/python-startup.py index a2d5cd9..973b3e4 100755 --- a/lib/python-startup.py +++ b/lib/python-startup.py @@ -9,7 +9,7 @@ try: except: pass -# bpython defines __name__ == "__console__" and gets broken by ANSI colors, so... -if __name__ == "__main__": +# bpython gets broken by ANSI colors, so skip those +if type(__builtins__) != dict: sys.ps1 = '\001\x1b[1;32m\002>>> \001\x1b[0m\002' sys.ps2 = '\001\x1b[0;32m\002... \001\x1b[0m\002'