From cec6e6f3bdc97471fb302f746e0a937d86c08717 Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Sun, 26 Feb 2023 21:25:55 -0600 Subject: [PATCH] use __debug__ --- BaseClasses.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 8e2a2f763d..6a0b761f60 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -6,11 +6,10 @@ import json import logging import random import secrets -import sys import typing # this can go away when Python 3.8 support is dropped from argparse import Namespace from collections import OrderedDict, Counter, deque -from enum import unique, IntEnum, IntFlag +from enum import IntEnum, IntFlag from typing import List, Dict, Optional, Set, Iterable, Union, Any, Tuple, TypedDict, Callable, NamedTuple import NetUtils @@ -587,7 +586,7 @@ class MultiWorld(): def location_relevant(location: Location): """Determine if this location is relevant to sweep.""" - if getattr(sys, "gettrace", None) \ + if __debug__ \ and location.progress_type != LocationProgressType.EXCLUDED \ and (location.player in players["full"] or location.event or (location.item and location.item.advancement)):