-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix for modpath_extensions_for function. #1474
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -587,9 +587,15 @@ def modpath_extensions_for(self, mod_names): | |
|
||
modpath_exts = {} | ||
for mod_name in mod_names: | ||
modtxt = self.read_module_file(mod_name) | ||
useregex = re.compile(r"^\s*module\s+use\s+(\S+)", re.M) | ||
exts = useregex.findall(modtxt) | ||
# Should be module show so as to catch conditional loads. | ||
modtxt = self.show(mod_name) | ||
useregex = re.compile(r"^\s*module\s+use\s+(\S+)|^\s*prepend_path\(\"MODULEPATH\",\s*\"(\S+)\"", re.M) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, do we have to consider single quotes here too in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, although since we are creating the line, we might be able to get away with only double. |
||
exts = [] | ||
for i in useregex.finditer(modtxt): | ||
if i.group(1): | ||
exts.append(i.group(1)) | ||
elif i.group(2): | ||
exts.append(i.group(2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, |
||
|
||
self.log.debug("Found $MODULEPATH extensions for %s: %s" % (mod_name, exts)) | ||
modpath_exts.update({mod_name: exts}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not loads, use statements