Skip to content

Commit 6c87cf8

Browse files
committed
Slightly different approach
1 parent 85ec0a7 commit 6c87cf8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mypy/fscache.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@ def init_under_package_root(self, path: str) -> bool:
117117
if not stat.S_ISDIR(st.st_mode):
118118
return False
119119
ok = False
120+
121+
# skip if on a different drive
122+
current_drive, _ = os.path.splitdrive(os.getcwd())
123+
drive, _ = os.path.splitdrive(path)
124+
if drive != current_drive:
125+
return False
120126
if os.path.isabs(path):
121127
path = os.path.relpath(path)
122-
drive, path = os.path.splitdrive(path) # Ignore Windows drive name
123128
path = os.path.normpath(path)
124129
for root in self.package_root:
125130
if path.startswith(root):

0 commit comments

Comments
 (0)