Swap try-catch for better .pop
This commit is contained in:
+1
-4
@@ -153,10 +153,7 @@ class SitesInformation:
|
||||
f"data file '{data_file_path}'."
|
||||
)
|
||||
|
||||
try:
|
||||
site_data.pop('$schema')
|
||||
except:
|
||||
pass
|
||||
site_data.pop('$schema', None)
|
||||
|
||||
self.sites = {}
|
||||
|
||||
|
||||
+1
-4
@@ -9,10 +9,7 @@ with open("sherlock/resources/data.json", "r", encoding="utf-8") as data_file:
|
||||
|
||||
# Removes schema-specific keywords for proper processing
|
||||
social_networks: dict = dict(data)
|
||||
try:
|
||||
social_networks.pop('$schema')
|
||||
except:
|
||||
pass
|
||||
social_networks.pop('$schema', None)
|
||||
|
||||
# Sort the social networks in alphanumeric order
|
||||
social_networks: list = sorted(social_networks.items())
|
||||
|
||||
Reference in New Issue
Block a user