Skip to content

Commit

Permalink
Misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Mar 19, 2021
1 parent e0ce172 commit ace02bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/client/datascience/kernel-launcher/localKernelFinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
} from '../jupyter/kernels/types';
import { IJupyterKernelSpec } from '../types';
import { ILocalKernelFinder } from './types';
import { tryGetRealPath } from '../common';
import { getResourceType, tryGetRealPath } from '../common';
import { isPythonNotebook } from '../notebook/helpers/helpers';

const winJupyterPath = path.join('AppData', 'Roaming', 'jupyter', 'kernels');
Expand Down Expand Up @@ -91,13 +91,14 @@ export class LocalKernelFinder implements ILocalKernelFinder {
try {
// Get list of all of the specs
const kernels = await this.listKernels(resource, cancelToken);
const isPythonNb = isPythonNotebook(option);
const isPythonNbOrInteractiveWindow =
isPythonNotebook(option) || getResourceType(resource) === 'interactive';

// Always include the interpreter in the search if we can
const interpreter =
option && isInterpreter(option)
? option
: resource && isPythonNb && this.extensionChecker.isPythonExtensionInstalled
: resource && isPythonNbOrInteractiveWindow && this.extensionChecker.isPythonExtensionInstalled
? await this.interpreterService.getActiveInterpreter(resource)
: undefined;

Expand Down

0 comments on commit ace02bb

Please sign in to comment.