File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ import platform
12import sys
23
34if sys .platform != "win32" :
45 import readline
56
67original_ps1 = ">>> "
78use_shell_integration = sys .version_info < (3 , 13 )
9+ is_wsl = "microsoft-standard-WSL" in platform .release ()
810
911
1012class REPLHooks :
@@ -73,5 +75,5 @@ def __str__(self):
7375 return result
7476
7577
76- if sys .platform != "win32" and use_shell_integration :
78+ if sys .platform != "win32" and ( not is_wsl ) and use_shell_integration :
7779 sys .ps1 = PS1 ()
Original file line number Diff line number Diff line change 11import importlib
2+ import platform
23import sys
34from unittest .mock import Mock
45
56import pythonrc
67
8+ is_wsl = "microsoft-standard-WSL" in platform .release ()
9+
710
811def test_decoration_success ():
912 importlib .reload (pythonrc )
1013 ps1 = pythonrc .PS1 ()
1114
1215 ps1 .hooks .failure_flag = False
1316 result = str (ps1 )
14- if sys .platform != "win32" :
17+ if sys .platform != "win32" and ( not is_wsl ) :
1518 assert (
1619 result
1720 == "\x1b ]633;E;None\x07 \x1b ]633;D;0\x07 \x1b ]633;A\x07 >>> \x1b ]633;B\x07 \x1b ]633;C\x07 "
@@ -26,7 +29,7 @@ def test_decoration_failure():
2629
2730 ps1 .hooks .failure_flag = True
2831 result = str (ps1 )
29- if sys .platform != "win32" :
32+ if sys .platform != "win32" and ( not is_wsl ) :
3033 assert (
3134 result
3235 == "\x1b ]633;E;None\x07 \x1b ]633;D;1\x07 \x1b ]633;A\x07 >>> \x1b ]633;B\x07 \x1b ]633;C\x07 "
You can’t perform that action at this time.
0 commit comments