fix type issue if python is missing when running unsandboxed (#610)

Clean up a small recently introduced type issue.
This commit is contained in:
Paul Fitzpatrick 2023-08-05 16:24:01 +01:00 committed by GitHub
parent 2e4a8ab8e0
commit 016ab66ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -999,7 +999,7 @@ const FAKETIME = '2020-01-01 00:00:00';
* Find a plausible version of python to run, if none provided.
* The preferred version is only used if command is not specified.
*/
function findPython(command: string|undefined, preferredVersion?: string) {
function findPython(command: string|undefined, preferredVersion?: string): string {
if (command) { return command; }
// No command specified. In this case, grist-core looks for a "venv"
// virtualenv; a python3 virtualenv would be in "sandbox_venv3".
@ -1028,6 +1028,7 @@ function findPython(command: string|undefined, preferredVersion?: string) {
return pythonPath;
}
}
throw new Error('Cannot find Python');
}
/**