summaryrefslogtreecommitdiff
path: root/requests_cache
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-04-28 11:04:16 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-04-28 11:04:16 -0500
commite932775bcea4246a1235d2dda1c6b09ce84a2625 (patch)
tree40c1153832a34ab094feb7bc67d2c0c29f2c3bbd /requests_cache
parent768ceea69bba68483ebef528bad2cb185844a452 (diff)
downloadrequests-cache-e932775bcea4246a1235d2dda1c6b09ce84a2625.tar.gz
Initialize backend with install_cache() prior to patching requests.Session
Diffstat (limited to 'requests_cache')
-rw-r--r--requests_cache/patcher.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/requests_cache/patcher.py b/requests_cache/patcher.py
index 6c24a35..ec3c32e 100644
--- a/requests_cache/patcher.py
+++ b/requests_cache/patcher.py
@@ -13,7 +13,7 @@ from typing import Optional, Type
import requests
-from .backends import BackendSpecifier, BaseCache
+from .backends import BackendSpecifier, BaseCache, init_backend
from .policy import ExpirationTime
from .session import CachedSession, OriginalSession
@@ -39,6 +39,7 @@ def install_cache(
session_factory: Session class to use. It must inherit from either
:py:class:`.CachedSession` or :py:class:`.CacheMixin`
"""
+ backend = init_backend(cache_name, backend, **kwargs)
class _ConfiguredCachedSession(session_factory): # type: ignore # See mypy issue #5865
def __init__(self):