diff options
author | dirkf <fieldhouse@gmx.net> | 2023-07-25 00:17:15 +0100 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2023-07-25 13:19:43 +0100 |
commit | a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3 (patch) | |
tree | 869bde60dab873963705baae5b879b94a4b9c3a9 /test/test_swfinterp.py | |
parent | aac33155e40af3da96a2467dd05faea201815989 (diff) |
[compat] Use `compat_open()`
Diffstat (limited to 'test/test_swfinterp.py')
-rw-r--r-- | test/test_swfinterp.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test_swfinterp.py b/test/test_swfinterp.py index 9f18055e6..7c282ee00 100644 --- a/test/test_swfinterp.py +++ b/test/test_swfinterp.py @@ -5,16 +5,18 @@ from __future__ import unicode_literals import os import sys import unittest -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +dirn = os.path.dirname + +sys.path.insert(0, dirn(dirn(os.path.abspath(__file__)))) import errno -import io import json import re import subprocess from youtube_dl.swfinterp import SWFInterpreter +from youtube_dl.compat import compat_open as open TEST_DIR = os.path.join( @@ -43,7 +45,7 @@ def _make_testfunc(testfile): '-static-link-runtime-shared-libraries', as_file]) except OSError as ose: if ose.errno == errno.ENOENT: - print('mxmlc not found! Skipping test.') + self.skipTest('mxmlc not found!') return raise @@ -51,7 +53,7 @@ def _make_testfunc(testfile): swf_content = swf_f.read() swfi = SWFInterpreter(swf_content) - with io.open(as_file, 'r', encoding='utf-8') as as_f: + with open(as_file, 'r', encoding='utf-8') as as_f: as_content = as_f.read() def _find_spec(key): |