(interpreter?: { id: string } | string)
| 148 | } |
| 149 | |
| 150 | export function getCachedEnvironment(interpreter?: { id: string } | string) { |
| 151 | if (!interpreter) { |
| 152 | return; |
| 153 | } |
| 154 | if (!pythonApi) { |
| 155 | throw new WrappedError('Python API not initialized', undefined, 'pythonAPINotInitialized'); |
| 156 | } |
| 157 | if (typeof interpreter === 'string') { |
| 158 | return pythonApi.environments.known.find( |
| 159 | // eslint-disable-next-line local-rules/dont-use-fspath |
| 160 | (i) => i.id === interpreter || i.path === interpreter || i.executable.uri?.fsPath === interpreter |
| 161 | ); |
| 162 | } |
| 163 | return pythonApi.environments.known.find((i) => i.id === interpreter.id); |
| 164 | } |
| 165 | |
| 166 | export async function getSysPrefix(interpreter?: { id: string }) { |
| 167 | if (!interpreter?.id) { |
no outgoing calls
no test coverage detected