From 6c692968a4c3cd5743eb46d6287e81b20399974d Mon Sep 17 00:00:00 2001 From: David Lynch Date: Sun, 6 Aug 2023 17:56:13 -0500 Subject: [PATCH] Use isinstance rather than direct type comparison --- sites/fictionlive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sites/fictionlive.py b/sites/fictionlive.py index 43b0fd8..4ad07f9 100644 --- a/sites/fictionlive.py +++ b/sites/fictionlive.py @@ -62,12 +62,12 @@ class FictionLive(Site): votes = {} for vote in segment['votes']: votechoices = segment['votes'][vote] - if type(votechoices) == str: + if isinstance(votechoices, str): # This caused issue #30, where for some reason one # choice on a story was a string rather than an # index into the choices array. continue - if type(votechoices) == int: + if isinstance(votechoices, int): votechoices = (votechoices,) for choice in votechoices: if int(choice) < len(segment['choices']):