diff options
author | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2020-07-10 15:57:53 +0300 |
---|---|---|
committer | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2020-07-10 15:58:16 +0300 |
commit | 80249e7190cd28cd3dad49f660ea202b7fc9fdef (patch) | |
tree | b93f62c6b387fa960faeb5cba161a3040c52f719 /methods.py | |
parent | ad9e5ae9848c8baf6fe462cf22d7f5677f478174 (diff) |
Expand env vars for `custom_modules` build option
The order of conversion is also changed to ensure that the resulting
path can be properly validated later on.
Diffstat (limited to 'methods.py')
-rw-r--r-- | methods.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/methods.py b/methods.py index ca6756f95f..7b853b7821 100644 --- a/methods.py +++ b/methods.py @@ -217,14 +217,15 @@ void unregister_module_types() { def convert_custom_modules_path(path): if not path: return path + path = os.path.realpath(os.path.expanduser(os.path.expandvars(path))) err_msg = "Build option 'custom_modules' must %s" if not os.path.isdir(path): raise ValueError(err_msg % "point to an existing directory.") - if os.path.realpath(path) == os.path.realpath("modules"): + if path == os.path.realpath("modules"): raise ValueError(err_msg % "be a directory other than built-in `modules` directory.") if is_module(path): raise ValueError(err_msg % "point to a directory with modules, not a single module.") - return os.path.realpath(os.path.expanduser(path)) + return path def disable_module(self): |