From 082f1a8fae9c3c4caf2f87b96f9d927418b48e6b Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Mon, 28 Oct 2024 11:59:35 -0700 Subject: [PATCH 1/4] disable shell integration for 3.13 --- python_files/pythonrc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python_files/pythonrc.py b/python_files/pythonrc.py index 2595143feade..859c8e0fda0f 100644 --- a/python_files/pythonrc.py +++ b/python_files/pythonrc.py @@ -4,7 +4,7 @@ import readline original_ps1 = ">>> " - +should_opt_out = sys.version_info.major == 3 and sys.version_info.minor == 13 class REPLHooks: def __init__(self): @@ -71,6 +71,5 @@ def __str__(self): return result - -if sys.platform != "win32": +if sys.platform != "win32" and not should_opt_out: sys.ps1 = PS1() From 5e94ea3e5de32042593a94fe119d2ef029162aca Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Mon, 28 Oct 2024 12:07:11 -0700 Subject: [PATCH 2/4] make the linter happy --- python_files/pythonrc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_files/pythonrc.py b/python_files/pythonrc.py index 859c8e0fda0f..4b4ec1b9ec93 100644 --- a/python_files/pythonrc.py +++ b/python_files/pythonrc.py @@ -6,6 +6,7 @@ original_ps1 = ">>> " should_opt_out = sys.version_info.major == 3 and sys.version_info.minor == 13 + class REPLHooks: def __init__(self): self.global_exit = None @@ -71,5 +72,6 @@ def __str__(self): return result + if sys.platform != "win32" and not should_opt_out: sys.ps1 = PS1() From b38b6fc7d578ee87d147204bcdaa810e3da40a5e Mon Sep 17 00:00:00 2001 From: Anthony Kim <62267334+anthonykim1@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:14:49 -0700 Subject: [PATCH 3/4] Update python_files/pythonrc.py Co-authored-by: Karthik Nadig --- python_files/pythonrc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_files/pythonrc.py b/python_files/pythonrc.py index 4b4ec1b9ec93..b4b04a580d3b 100644 --- a/python_files/pythonrc.py +++ b/python_files/pythonrc.py @@ -4,7 +4,7 @@ import readline original_ps1 = ">>> " -should_opt_out = sys.version_info.major == 3 and sys.version_info.minor == 13 +should_opt_out = sys.version_info >= (3, 13) class REPLHooks: From b1484ba606c96459b717f2dcd290edf38edf12fb Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Mon, 28 Oct 2024 13:18:08 -0700 Subject: [PATCH 4/4] take suggestion --- python_files/pythonrc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python_files/pythonrc.py b/python_files/pythonrc.py index b4b04a580d3b..5791bb3967c0 100644 --- a/python_files/pythonrc.py +++ b/python_files/pythonrc.py @@ -4,7 +4,7 @@ import readline original_ps1 = ">>> " -should_opt_out = sys.version_info >= (3, 13) +use_shell_integration = sys.version_info < (3, 13) class REPLHooks: @@ -73,5 +73,5 @@ def __str__(self): return result -if sys.platform != "win32" and not should_opt_out: +if sys.platform != "win32" and use_shell_integration: sys.ps1 = PS1()