Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 338ffdc

Browse files
committed
Use pathlib comparison over string comparison
1 parent fe04260 commit 338ffdc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

IPython/core/interactiveshell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,7 @@ def init_virtualenv(self):
923923
paths.append(p.resolve())
924924

925925
# In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
926-
if str(p_venv).startswith("\\cygdrive"):
927-
p_venv = Path(str(p_venv))
926+
if p_venv.parts[1] == "cygdrive":
928927
drive_name = p_venv.parts[2]
929928
p_venv = (drive_name + ":/") / Path(*p_venv.parts[3:])
930929

0 commit comments

Comments
 (0)