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:
parent
03e9d3844f
commit
6c692968a4
1 changed files with 2 additions and 2 deletions
|
|
@ -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']):
|
||||
|
|
|
|||
Loading…
Reference in a new issue