Repository navigation
Commit 24e807c
authored
Run Package Control settings helper in isolated mode (#308)
This commit fixes following scenario:
`install_package_control.sh` adds the packages listed by name in
`extra-packages` to Package Control's settings with `python3 -B -`. A script
read from stdin gets the current directory at the start of `sys.path`, and
that directory is usually the package checkout. So a module in the package's
root that has the name of a standard library module gets imported instead of
it.
In sublimelsp/LSP-elm, `types.py` breaks `import json` on macOS
(Homebrew Python 3.15), since `enum` imports `types`:
```
File "/Users/runner/work/LSP-elm/LSP-elm/types.py", line 3, in <module>
from LSP.protocol import DocumentUri
ModuleNotFoundError: No module named 'LSP'
```
Ubuntu and Windows pass, probably because their Python has already imported
`types` at startup.
`-I` (isolated mode) leaves the current directory and user site-packages off
`sys.path` and ignores `PYTHON*` environment variables. The helper only needs
the standard library. The PowerShell script doesn't run Python here.1 parent c18f8d0 commit 24e807c
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
0 commit comments