Skip to content

Commit 785b093

Browse files
authored
conditionally import reflect-metadata and fix run without debug (#455)
* Conditionally import `reflect-metadata` (fixes #432) * Once within the extension * Once within the debugger * Once within the unittests * Fully qualify the `path` module (fixes #454)
1 parent d2340d2 commit 785b093

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+20
-63
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python",
33
"displayName": "Python",
44
"description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.",
5-
"version": "0.9.0",
5+
"version": "0.9.1",
66
"publisher": "ms-python",
77
"author": {
88
"name": "Microsoft Corporation"

pythonFiles/PythonTools/visualstudio_py_launcher_nodebug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def handle_exception(exc_type, exc_value, exc_tb):
114114
tb = traceback.extract_tb(exc_tb)
115115
for i in [0, -1]:
116116
while tb:
117-
frame_file = path.normcase(tb[i][0])
117+
frame_file = os.path.normcase(tb[i][0])
118118
if not any(is_same_py_file(frame_file, f) for f in do_not_debug):
119119
break
120120
del tb[i]

src/client/common/envFileParser.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as fs from 'fs-extra';
2-
import 'reflect-metadata';
32
import { PathUtils } from './platform/pathUtils';
43
import { EnvironmentVariablesService } from './variables/environment';
54
import { EnvironmentVariables } from './variables/types';

src/client/common/installer/condaInstaller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import { inject, injectable } from 'inversify';
55
import * as path from 'path';
6-
import 'reflect-metadata';
76
import { Uri } from 'vscode';
87
import { ICondaLocatorService, IInterpreterLocatorService, INTERPRETER_LOCATOR_SERVICE, InterpreterType } from '../../interpreter/contracts';
98
import { CONDA_RELATIVE_PY_PATH } from '../../interpreter/locators/services/conda';

src/client/common/installer/installer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { inject, injectable, named } from 'inversify';
22
import * as os from 'os';
33
import * as path from 'path';
4-
import 'reflect-metadata';
54
import { ConfigurationTarget, QuickPickItem, Uri, window, workspace } from 'vscode';
65
import * as vscode from 'vscode';
76
import { IFormatterHelper } from '../../formatters/types';

src/client/common/installer/moduleInstaller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33

44
import { injectable } from 'inversify';
5-
import 'reflect-metadata';
65
import { Uri } from 'vscode';
76
import { IServiceContainer } from '../../ioc/types';
87
import { PythonSettings } from '../configSettings';

src/client/common/installer/pipInstaller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33

44
import { inject, injectable } from 'inversify';
5-
import 'reflect-metadata';
65
import { Uri, workspace } from 'vscode';
76
import { IServiceContainer } from '../../ioc/types';
87
import { IPythonExecutionFactory } from '../process/types';

src/client/common/logger.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { injectable } from 'inversify';
2-
import 'reflect-metadata';
32
import { ILogger } from './types';
43

54
const PREFIX = 'Python Extension: ';

src/client/common/persistentState.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
'use strict';
55

66
import { inject, injectable, named } from 'inversify';
7-
import 'reflect-metadata';
87
import { Memento } from 'vscode';
98
import { GLOBAL_MEMENTO, IMemento, IPersistentState, IPersistentStateFactory, WORKSPACE_MEMENTO } from './types';
109

0 commit comments

Comments
 (0)