Merge pull request #2515 from ChrisLR/XYMap-Django-Exception

Fix exception leaking when spawning XYRoom Nodes
This commit is contained in:
Griatch 2021-09-01 17:15:26 +02:00 committed by GitHub
commit c482ee3bc1

View file

@ -18,8 +18,10 @@ except ImportError as err:
import uuid
from collections import defaultdict
from django.core import exceptions as django_exceptions
from evennia.prototypes import spawner
from evennia.utils.utils import make_iter
from .utils import MAPSCAN, REVERSE_DIRECTIONS, MapParserError, BIGVAL
NodeTypeclass = None
@ -309,7 +311,7 @@ class MapNode:
try:
nodeobj = NodeTypeclass.objects.get_xyz(xyz=xyz)
except NodeTypeclass.DoesNotExist:
except django_exceptions.ObjectDoesNotExist:
# create a new entity with proper coordinates etc
tclass = self.prototype['typeclass']
tclass = (f' ({tclass})'
@ -433,7 +435,7 @@ class MapNode:
try:
nodeobj = NodeTypeclass.objects.get_xyz(xyz=xyz)
except NodeTypeclass.DoesNotExist:
except django_exceptions.ObjectDoesNotExist:
# no object exists
pass
else: