Skip to content

Commit

Permalink
FileCache.directory: explictly allow pathlib.Path (psf#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c authored and woodruffw committed Jul 3, 2024
1 parent 862df3c commit 6449d15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cachecontrol/caches/file_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import hashlib
import os
from textwrap import dedent
from typing import IO, TYPE_CHECKING
from typing import IO, TYPE_CHECKING, Union
from pathlib import Path

from cachecontrol.cache import BaseCache, SeparateBodyBaseCache
from cachecontrol.controller import CacheController
Expand Down Expand Up @@ -63,7 +64,7 @@ class _FileCacheMixin:

def __init__(
self,
directory: str,
directory: Union[str, Path],
forever: bool = False,
filemode: int = 0o0600,
dirmode: int = 0o0700,
Expand Down

0 comments on commit 6449d15

Please sign in to comment.