diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 703a8144260..6b9ea87cf71 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -373,7 +373,7 @@ def main(): # type: () -> None for path in args.path: # Cut off trailing slashes so os.path.basename doesn't choke. - if path.endswith(os.sep): + if path.endswith("/") or path.endswith("\\"): path = path[:-1] if os.path.basename(path) == "modules":