Commit 0dafc47
15110: set env var for subprocess, check version in script (#15122)
Fixes #15110
- Add PYTHONSAFEPATH="true" to call to subprocess in get_search_dirs()
- Check sys.version_info before modifying path in pyinfo.py
To test, import mypy.modulefinder.get_search_dirs & run:
- get_search_dirs() with no args
- on Python 3.11, call get_search_dirs with an earlier version as
python_executable
- on Python < 3.11, call get_search_dirs with Python 3.11 as
python_executable
Expected:
- consistent results, no exceptions
Co-authored-by: eevel <eevel@weezel3.weezelnet>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>1 parent e4217f2 commit 0dafc47
2 files changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| 754 | + | |
754 | 755 | | |
755 | 756 | | |
756 | 757 | | |
757 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
758 | 761 | | |
759 | 762 | | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
760 | 767 | | |
761 | 768 | | |
762 | 769 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments