1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 08:22:56 +01:00

Use isinstance rather than direct type comparison

This commit is contained in:
David Lynch 2023-08-06 17:56:13 -05:00
parent 03e9d3844f
commit 6c692968a4

View file

@ -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']):