Skip to content

Commit

Permalink
Use __import__()
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl committed Apr 24, 2021
1 parent 12e98a4 commit 6cab79c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/client/datascience/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,9 @@ export namespace DataFrameLoading {
export const DataFrameRowFunc = '_VSCODE_getDataFrameRows';

// Constants for the debugger which imports the script files
export const DataFrameImportName = '_VSCODE_DataFrameImport';
export const DataFrameImport = `import vscodeDataFrame as ${DataFrameImportName}`;
export const DataFrameInfoImportFunc = `${DataFrameImportName}._VSCODE_getDataFrameInfo`;
export const DataFrameRowImportFunc = `${DataFrameImportName}._VSCODE_getDataFrameRows`;
export const DataFrameImport = `__import__('vscodeDataFrame')`;
export const DataFrameInfoImportFunc = `${DataFrameImport}._VSCODE_getDataFrameInfo`;
export const DataFrameRowImportFunc = `${DataFrameImport}._VSCODE_getDataFrameRows`;
}

export namespace GetVariableInfo {
Expand All @@ -584,8 +583,7 @@ export namespace GetVariableInfo {
export const VariablePropertiesFunc = '_VSCODE_getVariableProperties';

// Constants for the debugger which imports the script files
export const VariableInfoImportName = '_VSCODE_VariableImport';
export const VariableInfoImport = `import vscodeGetVariableInfo as ${VariableInfoImportName}`;
export const VariableInfoImportName = `__import__('vscodeGetVariableInfo')`;
export const VariableInfoImportFunc = `${VariableInfoImportName}._VSCODE_getVariableInfo`;
}

Expand Down
2 changes: 0 additions & 2 deletions src/client/datascience/jupyter/debuggerVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ export class DebuggerVariables extends DebugLocationTracker
const key = this.debugService.activeDebugSession?.id;
if (key && !this.importedDataFrameScriptsIntoKernel.has(key)) {
await this.evaluate(DataFrameLoading.DataFrameSysImport);
await this.evaluate(DataFrameLoading.DataFrameImport);
this.importedDataFrameScriptsIntoKernel.add(key);
}
} catch (exc) {
Expand All @@ -279,7 +278,6 @@ export class DebuggerVariables extends DebugLocationTracker
const key = this.debugService.activeDebugSession?.id;
if (key && !this.importedGetVariableInfoScriptsIntoKernel.has(key)) {
await this.evaluate(GetVariableInfo.GetVariableInfoSysImport);
await this.evaluate(GetVariableInfo.VariableInfoImport);
this.importedGetVariableInfoScriptsIntoKernel.add(key);
}
} catch (exc) {
Expand Down

0 comments on commit 6cab79c

Please sign in to comment.