@@ -302,42 +302,46 @@ async function needToUpdateBundledPythonEnvInstallation(): Promise<boolean> {
302
302
303
303
const appVersion = app . getVersion ( ) ;
304
304
305
- // if the version in appData is latest, then assume it is latest
306
- if ( bundledEnvInAppData ) {
307
- const jlabVersionInAppData = bundledEnvInAppData . versions [ 'jupyterlab' ] ;
305
+ try {
306
+ // if the version in appData is latest, then assume it is latest
307
+ if ( bundledEnvInAppData ) {
308
+ const jlabVersionInAppData = bundledEnvInAppData . versions [ 'jupyterlab' ] ;
308
309
309
- if (
310
- semver . compare (
311
- versionWithoutSuffix ( jlabVersionInAppData ) ,
312
- versionWithoutSuffix ( appVersion )
313
- ) >= 0
314
- ) {
315
- return false ;
310
+ if (
311
+ semver . compare (
312
+ versionWithoutSuffix ( jlabVersionInAppData ) ,
313
+ versionWithoutSuffix ( appVersion )
314
+ ) >= 0
315
+ ) {
316
+ return false ;
317
+ }
316
318
}
317
- }
318
319
319
- // if not latest in appData check the active jupyterlab version
320
- // in case appData is outdated
321
- let outputVersion = '' ;
322
- if (
323
- await runCommandInEnvironment (
324
- getBundledPythonEnvPath ( ) ,
325
- "python -c 'import jupyterlab; print(jupyterlab.__version__)'" ,
326
- {
327
- stdout : msg => {
328
- outputVersion += msg ;
329
- }
330
- }
331
- )
332
- ) {
320
+ // if not latest in appData check the active jupyterlab version
321
+ // in case appData is outdated
322
+ let outputVersion = '' ;
333
323
if (
334
- semver . compare (
335
- versionWithoutSuffix ( outputVersion . trim ( ) ) ,
336
- versionWithoutSuffix ( appVersion )
337
- ) === - 1
324
+ await runCommandInEnvironment (
325
+ getBundledPythonEnvPath ( ) ,
326
+ "python -c 'import jupyterlab; print(jupyterlab.__version__)'" ,
327
+ {
328
+ stdout : msg => {
329
+ outputVersion += msg ;
330
+ }
331
+ }
332
+ )
338
333
) {
339
- return true ;
334
+ if (
335
+ semver . compare (
336
+ versionWithoutSuffix ( outputVersion . trim ( ) ) ,
337
+ versionWithoutSuffix ( appVersion )
338
+ ) === - 1
339
+ ) {
340
+ return true ;
341
+ }
340
342
}
343
+ } catch ( error ) {
344
+ log . error ( 'Failed to check for env update need.' , error ) ;
341
345
}
342
346
343
347
return false ;
0 commit comments