Skip to content

Commit 2bff682

Browse files
[scripts/init] Fix error running with default values (#8583)
Fixes: ```sh python scripts/init.py newsite https://newsite.com # [INFO] gallery_dl/extractor/newsite.py # [ERROR] TypeError: 'NoneType' object is not iterable # Traceback (most recent call last): # File "/gallery-dl/scripts/init.py", line 58, in init_extractor # fp.write(func(args)) # ^^^^^^^^^^ # File "/gallery-dl/scripts/init.py", line 88, in generate_module # {generate_extractors(args)}\ # ^^^^^^^^^^^^^^^^^^^^^^^^^ # File "/gallery-dl/scripts/init.py", line 108, in generate_extractors_basic # for subcat in args.subcategories: # TypeError: 'NoneType' object is not iterable # [INFO] gallery_dl/extractor/__init__.py # [INFO] test/results/newsite.py ```
1 parent 7b05995 commit 2bff682

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def parse_args(args=None):
317317

318318
parser.add_argument(
319319
"-s", "--subcategory",
320-
dest="subcategories", metavar="SUBCaT", action="append")
320+
dest="subcategories", metavar="SUBCaT", action="append", default=[])
321321
parser.add_argument(
322322
"-n", "--name",
323323
dest="site_name", metavar="TITLE")

0 commit comments

Comments
 (0)