about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2023-07-24 23:43:36 +0100
committerdirkf <fieldhouse@gmx.net>2023-07-25 13:19:43 +0100
commitaac33155e40af3da96a2467dd05faea201815989 (patch)
tree6bee082eabdf6ddf5b3322ad8282b02c1256cc6b /test
parent2b7dd3b2a2d7c6e228a42d1000a6f3296739ff1c (diff)
downloadyoutube-dl-aac33155e40af3da96a2467dd05faea201815989.tar.gz
youtube-dl-aac33155e40af3da96a2467dd05faea201815989.tar.xz
youtube-dl-aac33155e40af3da96a2467dd05faea201815989.zip
[build] Add and use `devscripts/utils`
Diffstat (limited to 'test')
-rw-r--r--test/test_execution.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test_execution.py b/test/test_execution.py
index 56e1b679d..9daaafa6c 100644
--- a/test/test_execution.py
+++ b/test/test_execution.py
@@ -8,14 +8,16 @@ import unittest
 import sys
 import os
 import subprocess
-sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+sys.path.insert(0, rootDir)
 
 from youtube_dl.compat import compat_register_utf8, compat_subprocess_get_DEVNULL
 from youtube_dl.utils import encodeArgument
 
 compat_register_utf8()
 
-rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
 _DEV_NULL = compat_subprocess_get_DEVNULL()
 
@@ -49,10 +51,10 @@ class TestExecution(unittest.TestCase):
             subprocess.check_call([sys.executable, os.path.normpath('devscripts/make_lazy_extractors.py'), lazy_extractors], cwd=rootDir, stdout=_DEV_NULL)
             subprocess.check_call([sys.executable, os.path.normpath('test/test_all_urls.py')], cwd=rootDir, stdout=_DEV_NULL)
         finally:
-            for x in ['', 'c'] if sys.version_info[0] < 3 else ['']:
+            for x in ('', 'c') if sys.version_info[0] < 3 else ('',):
                 try:
                     os.remove(lazy_extractors + x)
-                except (IOError, OSError):
+                except OSError:
                     pass