Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 02e5953

Browse files
committed
Use os.path.relpath
1 parent 77c97c1 commit 02e5953

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

script/validators/source_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def validate_file(file_path):
259259
if not validator(file_path):
260260
file_status = False
261261

262-
relative_path = file_path.replace(PELOTON_DIR, '')
262+
relative_path = os.path.relpath(file_path, start=PELOTON_DIR)
263263
if relative_path.startswith('/test/') and relative_path.endswith('.cpp'):
264264
if not relative_path.endswith('_util.cpp'):
265265
file_status = check_tests(file_path)

0 commit comments

Comments
 (0)