Skip to content

Commit 5267d46

Browse files
Fix Windows path separator regex escaping
1 parent 8b60bbc commit 5267d46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/pyright-scip/src/virtualenv/PythonEnvironment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as path from 'path';
22
import PythonPackage from './PythonPackage';
33

4-
const pathSepRegex = new RegExp(path.sep, 'g');
4+
const pathSepRegex = new RegExp(path.sep.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g');
55

66
export default class PythonEnvironment {
77
/// Maps a module name (x.y.z) to an index in this.packages

0 commit comments

Comments
 (0)