Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Reverted back for no visible impact. try-except adds more complexity to the design

Krishnasis Mandal86c31787e898
diff --git a/sflib.py b/sflib.py
index 8f84b1a1..852c7fd6 100644
--- a/sflib.py
+++ b/sflib.py
@@ -1204,17 +1204,13 @@ class SpiderFoot:
countryCode = ibanNumber[0:2]
- # Handling KeyError exception as a miss in the ibanCountryLengths dictionary
- # If the country code does not exist, it's an invalid IBAN Number
- try:
- countryCodeLength = ibanCountryLengths[countryCode]
- except KeyError:
+ if countryCode not in ibanCountryLengths.keys():
# Invalid IBAN Number due to country code not existing in dictionary
self.debug("Skipped invalid IBAN number: " + ibanNumber)
continue
# Using Mod 97 algorithm to verify if IBAN Number is valid
- if len(ibanNumber) == countryCodeLength:
+ if len(ibanNumber) == ibanCountryLengths[countryCode]:
# Move the first 4 characters to the end of the string
match = match[4:] + match[0:4]