about summary refs log tree commit diff
path: root/test/test_youtube_signature.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 /test/test_youtube_signature.py
parentaac33155e40af3da96a2467dd05faea201815989 (diff)
downloadyoutube-dl-a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3.tar.gz
youtube-dl-a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3.tar.xz
youtube-dl-a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3.zip
[compat] Use `compat_open()`
Diffstat (limited to 'test/test_youtube_signature.py')
-rw-r--r--test/test_youtube_signature.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py
index 5dcabaf95..f45dfec7c 100644
--- a/test/test_youtube_signature.py
+++ b/test/test_youtube_signature.py
@@ -8,11 +8,14 @@ import sys
 import unittest
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-import io
 import re
 import string
 
-from youtube_dl.compat import compat_str, compat_urlretrieve
+from youtube_dl.compat import (
+    compat_open as open,
+    compat_str,
+    compat_urlretrieve,
+)
 
 from test.helper import FakeYDL
 from youtube_dl.extractor import YoutubeIE
@@ -208,7 +211,7 @@ def t_factory(name, sig_func, url_pattern):
 
             if not os.path.exists(fn):
                 compat_urlretrieve(url, fn)
-            with io.open(fn, encoding='utf-8') as testf:
+            with open(fn, encoding='utf-8') as testf:
                 jscode = testf.read()
             self.assertEqual(sig_func(jscode, sig_input), expected_sig)