diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java index a82b0ebd9..d5175344d 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java @@ -276,9 +276,11 @@ public class PythonDistributionAnalyzer extends AbstractFileTypeAnalyzer { if (tempFileLocation != null && tempFileLocation.exists()) { LOGGER.debug("Attempting to delete temporary files"); final boolean success = FileUtils.delete(tempFileLocation); - if (!success) { - LOGGER.warn( - "Failed to delete some temporary files, see the log for more details"); + if (!success && tempFileLocation.exists()) { + final String[] l = tempFileLocation.list(); + if (l != null && l.length > 0) { + LOGGER.warn("Failed to delete some temporary files, see the log for more details"); + } } } }