Skip to content

Commit 7f642ea

Browse files
committed
Use Python's normpath()
Windows paths had mixed separators when using the path normalizer from skylib which appeared to cause some tests to fail.
1 parent a37924a commit 7f642ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/private/repl.bzl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
"""Implementation of the rules to expose a REPL."""
22

33
load("//python:py_binary.bzl", _py_binary = "py_binary")
4-
load("@bazel_skylib//lib:paths.bzl", "paths")
54

65
def _generate_repl_main_impl(ctx):
76
stub_repo = ctx.attr.stub.label.repo_name or ctx.workspace_name
8-
unnormalized_path = "/".join([stub_repo, ctx.file.stub.short_path])
9-
stub_path = paths.normalize(unnormalized_path)
7+
stub_path = "/".join([stub_repo, ctx.file.stub.short_path])
108

119
out = ctx.actions.declare_file(ctx.label.name + ".py")
1210

python/private/repl_template.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
from python.runfiles import runfiles
77

8-
STUB_PATH = "%stub_path%"
8+
# runfiles.py will reject paths which aren't normalized, which can happen when the REPL rules are
9+
# used from a remote module.
10+
STUB_PATH = os.path.normpath("%stub_path%")
911

1012

1113
def start_repl():

0 commit comments

Comments
 (0)