aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/cache.py
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2023-07-25 00:17:15 +0100
committerdirkf <fieldhouse@gmx.net>2023-07-25 13:19:43 +0100
commita25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3 (patch)
tree869bde60dab873963705baae5b879b94a4b9c3a9 /youtube_dl/cache.py
parentaac33155e40af3da96a2467dd05faea201815989 (diff)
downloadyoutube-dl-a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3.tar.xz
[compat] Use `compat_open()`
Diffstat (limited to 'youtube_dl/cache.py')
-rw-r--r--youtube_dl/cache.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube_dl/cache.py b/youtube_dl/cache.py
index 4822439d0..54123da0e 100644
--- a/youtube_dl/cache.py
+++ b/youtube_dl/cache.py
@@ -1,14 +1,16 @@
from __future__ import unicode_literals
import errno
-import io
import json
import os
import re
import shutil
import traceback
-from .compat import compat_getenv
+from .compat import (
+ compat_getenv,
+ compat_open as open,
+)
from .utils import (
error_to_compat_str,
expand_path,
@@ -83,7 +85,7 @@ class Cache(object):
cache_fn = self._get_cache_fn(section, key, dtype)
try:
try:
- with io.open(cache_fn, 'r', encoding='utf-8') as cachef:
+ with open(cache_fn, 'r', encoding='utf-8') as cachef:
return self._validate(json.load(cachef), min_ver)
except ValueError:
try: