mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Remove old python installation after new Python is successfully downloaded (#15931)
* remove old python after new download * remove catch
This commit is contained in:
@@ -202,9 +202,6 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
// Remove '0.0.1' from python executable path since the bundle version is removed from the path for ADS-Python 3.8.10+.
|
// Remove '0.0.1' from python executable path since the bundle version is removed from the path for ADS-Python 3.8.10+.
|
||||||
this._pythonExecutable = path.join(this._pythonInstallationPath, process.platform === constants.winPlatform ? 'python.exe' : 'bin/python3');
|
this._pythonExecutable = path.join(this._pythonInstallationPath, process.platform === constants.winPlatform ? 'python.exe' : 'bin/python3');
|
||||||
}
|
}
|
||||||
await fs.remove(this._oldPythonInstallationPath).catch(err => {
|
|
||||||
throw (err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,6 +473,8 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
if (this._oldUserInstalledPipPackages.length !== 0) {
|
if (this._oldUserInstalledPipPackages.length !== 0) {
|
||||||
await this.createInstallPipPackagesHelpNotebook(this._oldUserInstalledPipPackages);
|
await this.createInstallPipPackagesHelpNotebook(this._oldUserInstalledPipPackages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await fs.remove(this._oldPythonInstallationPath);
|
||||||
this._upgradeInProcess = false;
|
this._upgradeInProcess = false;
|
||||||
} else {
|
} else {
|
||||||
await vscode.commands.executeCommand('notebook.action.restartJupyterNotebookSessions');
|
await vscode.commands.executeCommand('notebook.action.restartJupyterNotebookSessions');
|
||||||
@@ -529,7 +528,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
|
|
||||||
let response = await vscode.window.showInformationMessage(msgPythonVersionUpdatePrompt(constants.pythonVersion), yes, no, dontAskAgain);
|
let response = await vscode.window.showInformationMessage(msgPythonVersionUpdatePrompt(constants.pythonVersion), yes, no, dontAskAgain);
|
||||||
if (response === yes) {
|
if (response === yes) {
|
||||||
this._oldPythonInstallationPath = path.join(this._pythonInstallationPath);
|
this._oldPythonInstallationPath = path.join(this._pythonInstallationPath, '0.0.1');
|
||||||
this._oldPythonExecutable = this._pythonExecutable;
|
this._oldPythonExecutable = this._pythonExecutable;
|
||||||
vscode.commands.executeCommand(constants.jupyterConfigurePython);
|
vscode.commands.executeCommand(constants.jupyterConfigurePython);
|
||||||
} else if (response === dontAskAgain) {
|
} else if (response === dontAskAgain) {
|
||||||
|
|||||||
Reference in New Issue
Block a user