Fixed silly error reporting when trying to create an object of a non-found typeclass.

This commit is contained in:
Griatch 2014-08-09 21:27:01 +02:00
parent f25d512c30
commit fdf5c723d2

View file

@ -150,7 +150,11 @@ def create_object(typeclass=None, key=None, location=None,
if not _GA(new_object, "is_typeclass")(typeclass, exact=True):
# this will fail if we gave a typeclass as input and it still
# gave us a default
SharedMemoryModel.delete(new_db_object)
try:
SharedMemoryModel.delete(new_db_object)
except AssertionError:
# this happens if object was never created
pass
if report_to:
report_to = handle_dbref(report_to, _ObjectDB)
_GA(report_to, "msg")("Error creating %s (%s).\n%s" % (new_db_object.key, typeclass,