b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/src/pip/_vendor/pyproject_hooks/_in_process/__init__.py |
| 2 | +++ b/src/pip/_vendor/pyproject_hooks/_in_process/__init__.py |
| 3 | @@ -11,8 +11,14 @@ try: |
| 4 | except AttributeError: |
| 5 | # Python 3.8 compatibility |
| 6 | def _in_proc_script_path(): |
| 7 | - return resources.path(__package__, '_in_process.py') |
| 8 | + filename = '_in_process.pyc' |
| 9 | + if resources.is_resource(__package__, '_in_process.py'): |
| 10 | + filename = '_in_process.py' |
| 11 | + return resources.path(__package__, filename) |
| 12 | else: |
| 13 | def _in_proc_script_path(): |
| 14 | + filename = '_in_process.pyc' |
| 15 | + if resources.files(__package__).joinpath('_in_process.py').is_file(): |
| 16 | + filename = '_in_process.py' |
| 17 | return resources.as_file( |
| 18 | - resources.files(__package__).joinpath('_in_process.py')) |
| 19 | + resources.files(__package__).joinpath(filename)) |