Skip to content

Commit

Permalink
Extract local variable refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Apr 8, 2024
1 parent ad59ac0 commit a23b4ad
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ public CAstNode visitImportFrom(ImportFrom importFrom) throws Exception {

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

if (isLocalModule(moduleName)) {
if (localModule) {
List<File> pythonPath = PythonModuleParser.this.getPythonPath();

// If there is a PYTHONPATH specified.
if (pythonPath != null && !pythonPath.isEmpty()) {
// Adjust the module name per the PYTHONPATH.
Optional<SourceModule> localModule = getLocalModule(moduleName);
Optional<SourceModule> module = getLocalModule(moduleName);

for (File pathEntry : pythonPath) {
Path modulePath =
localModule
module
.map(SourceModule::getURL)
.map(URL::getFile)
.map(Path::of)
Expand Down

0 comments on commit a23b4ad

Please sign in to comment.