Skip to content

Commit

Permalink
Merge release branch fixes (#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchiodo committed Nov 10, 2018
1 parent 753a1e8 commit d0c239f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2018.10.1 (09 Nov 2018)

### Fixes

1. When attempting to 'Run Cell', get error - Cannot read property 'length' of null
([#3286](https://github.com/Microsoft/vscode-python/issues/3286))

## 2018.10.0 (08 Nov 2018)

### Thanks
Expand Down
26 changes: 20 additions & 6 deletions src/client/datascience/jupyterServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { IFileSystem } from '../common/platform/types';
import { IDisposableRegistry, ILogger } from '../common/types';
import { createDeferred } from '../common/utils/async';
import * as localize from '../common/utils/localize';
import { IInterpreterService } from '../interpreter/contracts';
import { RegExpValues } from './constants';
import { JupyterInstallError } from './jupyterInstallError';
import { CellState, ICell, IJupyterExecution, INotebookProcess, INotebookServer } from './types';
Expand All @@ -40,7 +41,8 @@ export class JupyterServer implements INotebookServer {
@inject(IFileSystem) private fileSystem: IFileSystem,
@inject(IDisposableRegistry) private disposableRegistry: IDisposableRegistry,
@inject(IJupyterExecution) private jupyterExecution : IJupyterExecution,
@inject(IWorkspaceService) private workspaceService: IWorkspaceService) {
@inject(IWorkspaceService) private workspaceService: IWorkspaceService,
@inject(IInterpreterService) private interpreterService: IInterpreterService) {
}

public start = async () : Promise<boolean> => {
Expand Down Expand Up @@ -370,11 +372,23 @@ export class JupyterServer implements INotebookServer {
score += 1;

// See if the version is the same
if (pythonVersion) {
const digits = spec.name.match(/\d+/g);
if (digits && digits.length > 0 && parseInt(digits[0], 10) === pythonVersion[0]) {
// Major version match
score += 4;
if (pythonVersion && spec.argv.length > 0 && await fs.pathExists(spec.argv[0])) {
const details = await this.interpreterService.getInterpreterDetails(spec.argv[0]);
if (details && details.version_info) {
if (details.version_info[0] === pythonVersion[0]) {
// Major version match
score += 4;

if (details.version_info[1] === pythonVersion[1]) {
// Minor version match
score += 2;

if (details.version_info[2] === pythonVersion[2]) {
// Minor version match
score += 1;
}
}
}
}
}
}
Expand Down

0 comments on commit d0c239f

Please sign in to comment.