From a23b4adafa2254cf818d7aab29a01311ec4b39ca Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Tue, 2 Apr 2024 12:23:28 -0400 Subject: [PATCH] Extract local variable refactoring. --- .../com/ibm/wala/cast/python/parser/PythonModuleParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/parser/PythonModuleParser.java b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/parser/PythonModuleParser.java index b8e19beb4..b514e913c 100644 --- a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/parser/PythonModuleParser.java +++ b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/parser/PythonModuleParser.java @@ -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 pythonPath = PythonModuleParser.this.getPythonPath(); // If there is a PYTHONPATH specified. if (pythonPath != null && !pythonPath.isEmpty()) { // Adjust the module name per the PYTHONPATH. - Optional localModule = getLocalModule(moduleName); + Optional module = getLocalModule(moduleName); for (File pathEntry : pythonPath) { Path modulePath = - localModule + module .map(SourceModule::getURL) .map(URL::getFile) .map(Path::of)