Skip to content

Commit ac2aa1e

Browse files
committed
fix unhashable dict error
1 parent 00ce812 commit ac2aa1e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.5
1+
0.1.6

tmdbapis/tmdb.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ def _tv_genre_lookup(self):
7777

7878
def _get_object(self, lookup, obj_type):
7979
def object_check(lookup_obj, key, lookup_dict, is_int=False):
80-
if isinstance(lookup_obj, dict) and key in lookup_obj:
81-
lookup_obj = lookup_obj[key]
82-
return lookup_dict[int(lookup_obj) if is_int else lookup_obj] if lookup_obj in lookup_dict else None
80+
if isinstance(lookup_obj, dict):
81+
lookup_obj = lookup_obj[key] if key in lookup_obj else None
82+
if is_int:
83+
lookup_obj = int(lookup_obj)
84+
return lookup_dict[lookup_obj] if lookup_obj in lookup_dict else None
8385
if obj_type == "country":
8486
return object_check(lookup, "iso_3166_1", self._iso_3166_1)
8587
elif obj_type == "language":

0 commit comments

Comments
 (0)