File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 10
10
11
11
try :
12
12
import coverage
13
+
14
+ # ST4 does not ship `_sysconfigdata__darwin_darwin` module, required by
15
+ # coverage 7.x on MacOS, which causes `sysconfig.add_paths()` to fail.
16
+ # On other OSs it returns potentially unwanted paths outside of ST ecosystem.
17
+ # Thus monkey patch it.
18
+ try :
19
+ import coverage .inorout
20
+
21
+ def __add_third_party_paths (paths ):
22
+ """Return $data/Lib/pythonXY as 3rd-party path."""
23
+ libs_path = os .path .join (
24
+ os .path .dirname (sublime .packages_path ()),
25
+ "Lib" ,
26
+ "python{}{}" .format (sys .version_info .major , sys .version_info .minor )
27
+ )
28
+ paths .add (libs_path )
29
+
30
+ coverage .inorout .add_third_party_paths = __add_third_party_paths
31
+ except :
32
+ pass
33
+
13
34
except Exception :
14
35
coverage = False
15
36
You can’t perform that action at this time.
0 commit comments