Skip to content

Commit

Permalink
Attempting a fix and to debug Nonetype error.
Browse files Browse the repository at this point in the history
Attempting a fix and to debug Nonetype error.
  • Loading branch information
spacetimeengineer committed Feb 25, 2025
1 parent 68963ef commit a996319
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pbp/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,18 @@ def replace_snippets(
A new dictionary with the snippets replaced.
"""
result = OrderedDict()
print("attributes.items() : Error was here->")
print(attributes.items())
print()
for k, v in attributes.items():
if isinstance(v, str):
for snippet, replacement in snippets.items():
if isinstance(replacement, dict):
pass
else:
v = v.replace(snippet, replacement)
result[k] = v
return result
try:
v = v.replace(snippet, replacement)
result[k] = v
except TypeError:
pass
return result

0 comments on commit a996319

Please sign in to comment.