summaryrefslogtreecommitdiff
path: root/dev-python/mypy/files/use-which.patch
blob: bca26f03c76e45315c09f8e27395cf80c19338b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/scripts/mypy b/scripts/mypy
index e758f1f..5a06146 100755
--- a/scripts/mypy
+++ b/scripts/mypy
@@ -45,14 +45,7 @@ def find_bin_directory() -> str:
 
     This is used by build to find stubs and other data files.
     """
-    script = __file__
-    # Follow up to 5 symbolic links (cap to avoid cycles).
-    for i in range(5):
-        if os.path.islink(script):
-            script = readlinkabs(script)
-        else:
-            break
-    return os.path.dirname(script)
+    return os.path.dirname(shutil.which('mypy'))
 
 
 def readlinkabs(link: str) -> str: