@@ -139,13 +139,13 @@ def __init__(
139139 self.fetcher = copyfrom.fetcher
140140 else:
141141 import requests
142- from cachecontrol.caches import FileCache
142+ from cachecontrol.caches import SeparateBodyFileCache
143143 from cachecontrol.wrapper import CacheControl
144144
145145 root = pathlib.Path(os.environ.get("HOME", tempfile.gettempdir()))
146146 session = CacheControl(
147147 requests.Session(),
148- cache=FileCache (root / ".cache" / "salad"),
148+ cache=SeparateBodyFileCache (root / ".cache" / "salad"),
149149 )
150150 self.fetcher: Fetcher = DefaultFetcher({}, session)
151151
@@ -293,9 +293,9 @@ def parse_errors(error_message: str) -> Tuple[str, str, str]:
293293 types.add(individual_vals[-1].strip("."))
294294 else:
295295 types.add(individual_vals[1].replace(",", ""))
296- types = set( val for val in types if val != "NoneType")
296+ types = { val for val in types if val != "NoneType"}
297297 if "str" in types:
298- types = set( convert_typing(val) for val in types if "'" not in val)
298+ types = { convert_typing(val) for val in types if "'" not in val}
299299 to_print = ""
300300 for val in types:
301301 if "'" in val:
@@ -463,9 +463,7 @@ def load(
463463 lc: Optional[List[Any]] = None,
464464 ) -> Any:
465465 if not isinstance(doc, self.tp):
466- raise ValidationException(
467- "Expected a {} but got {}".format(self.tp, doc.__class__.__name__)
468- )
466+ raise ValidationException(f"Expected a {self.tp} but got {doc.__class__.__name__}")
469467 return doc
470468
471469 def __repr__(self) -> str:
@@ -495,7 +493,7 @@ def load(
495493 for i in range(0, len(doc)):
496494 try:
497495 lf = load_field(
498- doc[i], _UnionLoader(( [self, self.items]) ), baseuri, loadingOptions, lc=lc
496+ doc[i], _UnionLoader([self, self.items]), baseuri, loadingOptions, lc=lc
499497 )
500498 flatten = loadingOptions.container != "@list"
501499 if flatten and isinstance(lf, MutableSequence):
0 commit comments