Enforce with_child basename is str.

master
voussoir 2021-12-02 19:32:25 -08:00
parent e2fd04ccf1
commit 19afbc2105
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 2 additions and 0 deletions

View File

@ -466,6 +466,8 @@ class Path:
yield from directory.walk()
def with_child(self, basename, **spawn_kwargs):
if not isinstance(basename, str):
raise TypeError(f'basename must be {str}, not {type(basename)}.')
parts = (*self._parts, basename)
return Path(parts, **spawn_kwargs)