From 051dab69cd81cfe4e15b7c5e989712bbe0d826b9 Mon Sep 17 00:00:00 2001 From: Roman Trapeznikov Date: Wed, 20 May 2020 21:49:06 +0300 Subject: [PATCH] observe type-checking :/ --- assets/src/ba_data/python/ba/_profile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/src/ba_data/python/ba/_profile.py b/assets/src/ba_data/python/ba/_profile.py index 3a7bcf93..e29384c6 100644 --- a/assets/src/ba_data/python/ba/_profile.py +++ b/assets/src/ba_data/python/ba/_profile.py @@ -82,9 +82,9 @@ def get_player_profile_colors( highlight = (0.4, 0.4, 0.5) else: try: - color = profiles[profilename]['color'] assert profilename is not None - except KeyError: + color = profiles[profilename]['color'] + except (KeyError, AssertionError): # key off name if possible if profilename is None: # first 6 are bright-ish @@ -94,9 +94,9 @@ def get_player_profile_colors( color = PLAYER_COLORS[sum([ord(c) for c in profilename]) % 6] try: - highlight = profiles[profilename]['highlight'] assert profilename is not None - except KeyError: + highlight = profiles[profilename]['highlight'] + except (KeyError, AssertionError): # key off name if possible if profilename is None: # last 2 are grey and white; ignore those or we