Skip to content

Commit 53d1f72

Browse files
authored
Fixes to CI (#5907)
1 parent 65c056f commit 53d1f72

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/client/terminals/codeExecution/helper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
2929
if (code.trim().length === 0) {
3030
return '';
3131
}
32+
// On windows cr is not handled well by python when passing in/out via stdin/stdout.
33+
// So just remove cr from the input.
34+
code = code.replace(new RegExp('\\r', 'g'), '');
3235
const pythonPath = this.configurationService.getSettings(resource).pythonPath;
3336
const args = [path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'normalizeForInterpreter.py'), code];
3437
const processService = await this.processServiceFactory.create(resource);

src/test/terminals/codeExecution/helper.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ suite('Terminal - Code Execution Helper', () => {
9595
const doubleCrIndex = normalizedCode.indexOf('\r\r');
9696
expect(doubleCrIndex).to.be.equal(-1, 'Double CR (CRCRLF) line endings detected in normalized code snippet.');
9797
});
98-
// https://github.com/microsoft/vscode-python/issues/5896
99-
// https://dev.azure.com/ms/vscode-python/_build/results?buildId=18374&view=ms.vss-test-web.build-test-results-tab
100-
// Remove '8' from the array.
101-
['', '1', '2', '3', '4', '5', '6', '7'].forEach(fileNameSuffix => {
98+
['', '1', '2', '3', '4', '5', '6', '7', '8'].forEach(fileNameSuffix => {
10299
test(`Ensure blank lines are removed (Sample${fileNameSuffix})`, async function () {
103100
// This test has not been working for many months in Python 2.7 under
104101
// Windows.Tracked by #2544.

0 commit comments

Comments
 (0)