Avoid errors when destroying failed Cosmology object
@@ -346,7 +346,10 @@ class Cosmology(object):
"""Free the ccl_cosmology instance that this Cosmology object is managing.
"""
+ try:
lib.cosmology_free(self.cosmo)
+ except:
+ pass
def __str__(self):
"""Output the cosmological parameters that were set, and their values,
