better handling of non-iterable objects
@@ -249,6 +249,10 @@ class Owner(commands.Cog):
for i, obj in enumerate(thing):
mem_usage[i] = self.get_mem_usage(obj) / 1000000
else:
+ try:
+ for name, obj in thing.__dict__.items():
+ mem_usage[name] = self.get_mem_usage(obj) / 1000000
+ except AttributeError:
mem_usage['thing'] = self.get_mem_usage(thing) / 1000000
mem_usage_sorted = sorted(mem_usage.items(), key=(lambda t: t[1]), reverse=True)[:25]
