[ytdl] ignore SyntaxErrors when trying to import a module

This commit is contained in:
Mike Fährmann
2024-08-29 19:28:08 +02:00
parent cf8e04d999
commit 127aa45834
3 changed files with 5 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ class Test_CommandlineArguments(unittest.TestCase):
def setUpClass(cls):
try:
cls.module = __import__(cls.module_name)
except ImportError:
except (ImportError, SyntaxError):
raise unittest.SkipTest("cannot import module '{}'".format(
cls.module_name))
cls.default = ytdl.parse_command_line(cls.module, [])