Skip to content

Commit

Permalink
Localize log.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Apr 8, 2024
1 parent d35b1dc commit 6cc6742
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public CAstNode visitImportFrom(ImportFrom importFrom) throws Exception {
String moduleName = s.get();
LOGGER.finer("Module name from " + importFrom + " is: " + moduleName + ".");

if (!isLocalModule(moduleName)) moduleName += "/" + MODULE_INITIALIZATION_ENTITY_NAME;
if (!isLocalModule(moduleName)) moduleName = s.get() + "/__init__";

LOGGER.finer("Module name from " + importFrom + " is: " + moduleName + ".");

Expand Down Expand Up @@ -285,9 +285,13 @@ protected Reader getReader() throws IOException {
}

private boolean isLocalModule(String moduleName) {
return localModules.stream()
.map(lm -> scriptName((SourceModule) lm))
.anyMatch(sn -> sn.endsWith(moduleName + ".py"));
boolean ret =
localModules.stream()
.map(lm -> scriptName((SourceModule) lm))
.anyMatch(sn -> sn.endsWith(moduleName + ".py"));

LOGGER.finer("Module: " + moduleName + (ret ? " is" : " isn't") + " local.");
return ret;
}

/**
Expand Down

0 comments on commit 6cc6742

Please sign in to comment.