mirror of
https://github.com/encounter/dtk-template.git
synced 2025-12-19 01:46:19 +00:00
Fix Windows path handling
ninja_syntax.py should be writing native platform paths instead of converting things to unix paths. Separately, fixed type errors introduced by the previous commit.
This commit is contained in:
@@ -21,6 +21,7 @@ use Python.
|
||||
|
||||
import re
|
||||
import textwrap
|
||||
import os
|
||||
from io import StringIO
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Match, Optional, Tuple, Union
|
||||
@@ -215,7 +216,12 @@ class Writer(object):
|
||||
|
||||
|
||||
def serialize_path(input: Optional[NinjaPath]) -> str:
|
||||
return str(input).replace("\\", "/") if input else ""
|
||||
if not input:
|
||||
return ""
|
||||
if isinstance(input, Path):
|
||||
return str(input).replace("/", os.sep)
|
||||
else:
|
||||
return str(input)
|
||||
|
||||
|
||||
def serialize_paths(input: Optional[NinjaPathOrPaths]) -> List[str]:
|
||||
|
||||
Reference in New Issue
Block a user