fix api
This commit is contained in:
@ -68,8 +68,8 @@ class AsObj:
|
||||
return reversed(self._dict())
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(self, key):
|
||||
return self.__dict__.__class_getitem__(key)
|
||||
def __class_getitem__(cls, key):
|
||||
return cls.__dict__.__class_getitem__(key)
|
||||
|
||||
def __ior__(self, value):
|
||||
return self._dict().__ior__(value)
|
||||
|
@ -3,13 +3,12 @@
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
from functools import lru_cache
|
||||
|
||||
import requests
|
||||
import requests.exceptions
|
||||
|
||||
from .as_obj import AsObj
|
||||
from .exceptions import TMDbException
|
||||
from functools import lru_cache
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -196,4 +195,6 @@ class TMDb(object):
|
||||
if "success" in json and json["success"] is False:
|
||||
raise TMDbException(json["status_message"])
|
||||
|
||||
return AsObj(json, key=key)
|
||||
if key:
|
||||
return json.get(key)
|
||||
return json
|
||||
|
Reference in New Issue
Block a user