Skip to content

Commit 27e3393

Browse files
committed
Fix Python paths on Windows
1 parent 43b71e7 commit 27e3393

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/scripts/generate-wrappers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function getClassConfig(className, doLog) {
9494

9595
function relativePathToPythonImportPath(relativePath) {
9696

97-
var tokens = relativePath.split(path.sep);
97+
var tokens = relativePath.split(/\\|\//);
9898
var firstToken = tokens[0];
9999
var sawFolderToken = false;
100100

@@ -709,8 +709,8 @@ _.extend(PythonWrapper.prototype, {
709709
},
710710

711711
processDocsUrl: function() {
712-
713-
var refTokens = this.modulePath.split(path.sep);
712+
713+
var refTokens = this.modulePath.split(/\\|\//);
714714

715715
// capitalize elements in url
716716
refTokens = refTokens.map(function(token) {
@@ -792,7 +792,7 @@ function createTopLevelPythonModuleFile() {
792792

793793
// convert relative path to python-style import path
794794
if (modulePath !== '.') {
795-
var importPath = '.' + modulePath.split(path.sep).join('.') + '.' + moduleName;
795+
var importPath = '.' + modulePath.split(/\\|\//).join('.') + '.' + moduleName;
796796
} else {
797797
var importPath = '.' + moduleName;
798798
}

0 commit comments

Comments
 (0)