mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-10-02 14:28:36 +09:00
[compat] Use compat_open()
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user