From da632631a2c4814ed33d88abfa484d1758f18115 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Sun, 3 Nov 2013 00:33:06 +0800 Subject: [PATCH] Test whether input_files is a str --- danmaku2ass.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/danmaku2ass.py b/danmaku2ass.py index b551ba1..e50f098 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -339,6 +339,8 @@ def ConvertToFile(filename_or_file, *args, **kwargs): def Danmaku2ASS(input_files, output_file, stage_width, stage_height, reserve_blank=0, font_face=_('(FONT) sans-serif')[7:], font_size=25.0, text_opaque=1.0, comment_duration=5.0, is_reduce_comments=False): + if isinstance(input_files, str): + input_files = [input_files] comments = [] for i in input_files: with ConvertToFile(i, 'r', encoding='utf-8') as f: