only delete the attribute if it exists

This commit is contained in:
Peter Josef Scheibel
2022-10-20 13:54:09 -06:00
committed by Gregory Becker
parent 2ad94bc76a
commit 2b5be8c52a

View File

@@ -1378,7 +1378,7 @@ def get_pkg_class(self, pkg_name):
setattr(cls, key, val)
if new_overidden_attrs:
setattr(cls, "overidden_attrs", dict(new_overidden_attrs))
else:
elif hasattr(cls, "overidden_attrs"):
delattr(cls, "overidden_attrs")
return cls