Bug #1227 » 0031-Remove-deprecated-pathlib.PurePath.is_reserved-usage.patch
common/generate_packets.py | ||
---|---|---|
"""Parse the given path and check basic validity."""
|
||
path = Path(s)
|
||
if path.is_reserved() or not path.name:
|
||
if not path.name:
|
||
raise ValueError(f"not a valid file path: {s!r}")
|
||
if path.exists() and not path.is_file():
|
||
raise ValueError(f"not a file: {s!r}")
|
gen_headers/generate_enums.py | ||
---|---|---|
"""Parse the given path and check basic validity."""
|
||
path = Path(s)
|
||
if path.is_reserved() or not path.name:
|
||
if not path.name:
|
||
raise ValueError(f"not a valid file path: {s!r}")
|
||
if path.exists() and not path.is_file():
|
||
raise ValueError(f"not a file: {s!r}")
|