attempt to fix recursive_update()
@@ -2,10 +2,10 @@ import classyjson as cj
import math
def recursive_update(obj, new): # hOlY FUCKING SHIT this is so big brained I AM A GOD
- if isinstance(obj, dict):
+ if isinstance(obj, dict) and isinstance(new, dict):
for k, v in new.items():
obj[k] = recursive_update(obj.get(k, cj.classify({})), v)
- elif isinstance(obj, list):
+ elif isinstance(obj, list) and isinstance(new, list):
for i, v in enumerate(new):
obj[i] = recursive_update(obj[i], v) if i < len(obj) else v
else:
