diff options
Diffstat (limited to 'mesonbuild/modules/fs.py')
-rw-r--r-- | mesonbuild/modules/fs.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py index 9b2cb8b..f006500 100644 --- a/mesonbuild/modules/fs.py +++ b/mesonbuild/modules/fs.py @@ -14,7 +14,7 @@ import typing as T import hashlib -from pathlib import Path, PurePath +from pathlib import Path, PurePath, PureWindowsPath from .. import mlog from . import ExtensionModule @@ -62,6 +62,13 @@ class FSModule(ExtensionModule): @stringArgs @noKwargs + def expanduser(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: + if len(args) != 1: + raise MesonException('fs.expanduser takes exactly one argument.') + return ModuleReturnValue(str(Path(args[0]).expanduser()), []) + + @stringArgs + @noKwargs def is_absolute(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: if len(args) != 1: raise MesonException('fs.is_absolute takes exactly one argument.') |