Skip to content

Commit 745998a

Browse files
committed
stringUtils.ts: replace backslashes with forward-slashes only on non-Windows platforms.
1 parent 32822e0 commit 745998a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/extension/common/stringUtils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
import { getOSType, OSType } from './platform';
5+
46
/**
57
* Replaces all instances of a substring with a new substring.
68
*/
@@ -61,5 +63,9 @@ export function fileToCommandArgumentForPythonExt(source: string): string {
6163

6264
let result = toCommandArgumentForPythonExt(source);
6365

64-
return result.replace(/\\/g, '/');
66+
if (getOSType() !== OSType.Windows) {
67+
result = result.replace(/\\/g, '/');
68+
}
69+
70+
return result;
6571
}

0 commit comments

Comments
 (0)