summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-10 16:40:45 +0200
committerGitHub <noreply@github.com>2020-07-10 16:40:45 +0200
commit70e21154f0416c13655ad8ce176a1b899a5e70d2 (patch)
tree840d004bd1892b23cb404a5623ed5ea99fc40fba
parent7bb1cef5c8b46637304e075da7bcd0dcfd42b211 (diff)
parent80249e7190cd28cd3dad49f660ea202b7fc9fdef (diff)
Merge pull request #40257 from Xrayez/custom-modules-expandvars
Expand env vars for `custom_modules` build option
-rw-r--r--methods.py5
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):