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