From 63d4cc0e80907727823dca19aa63d8005a050a2a Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Thu, 15 Jul 2021 06:50:46 -0700 Subject: [PATCH] don't show python upgrade prompt multiple times (#16080) --- extensions/notebook/src/jupyter/jupyterServerInstallation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts index 94c4b4460c..d7a8dfd9c2 100644 --- a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts +++ b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts @@ -121,6 +121,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { private _oldPythonExecutable: string | undefined; private _oldPythonInstallationPath: string | undefined; private _oldUserInstalledPipPackages: PythonPkgDetails[] = []; + private _upgradePrompted: boolean = false; private _installInProgress: boolean; private _installCompletion: Deferred; @@ -506,7 +507,8 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { let isPythonInstalled = JupyterServerInstallation.isPythonInstalled(); // If the latest version of ADS-Python is not installed, then prompt the user to upgrade - if (isPythonInstalled && !this._usingExistingPython && utils.compareVersions(await this.getInstalledPythonVersion(this._pythonExecutable), constants.pythonVersion) < 0) { + if (!this._upgradePrompted && isPythonInstalled && !this._usingExistingPython && utils.compareVersions(await this.getInstalledPythonVersion(this._pythonExecutable), constants.pythonVersion) < 0) { + this._upgradePrompted = true; this.promptUserForPythonUpgrade(); }