initialize 'hooks' as empty tuple
follow-up to 9c29fc4e
Prevent a "race" between initializing 'pathfmt' and 'hooks',
and receiving a signal in between (e.g. ctrl+c),
which would then crash in 'handle_finalize()'.
This commit is contained in:
@@ -194,7 +194,7 @@ class DownloadJob(Job):
|
|||||||
self.blacklist = None
|
self.blacklist = None
|
||||||
self.archive = None
|
self.archive = None
|
||||||
self.sleep = None
|
self.sleep = None
|
||||||
self.hooks = None
|
self.hooks = ()
|
||||||
self.downloaders = {}
|
self.downloaders = {}
|
||||||
self.out = output.select()
|
self.out = output.select()
|
||||||
|
|
||||||
@@ -411,9 +411,9 @@ class DownloadJob(Job):
|
|||||||
if self.archive:
|
if self.archive:
|
||||||
self.archive.check = pathfmt.exists
|
self.archive.check = pathfmt.exists
|
||||||
|
|
||||||
self.hooks = collections.defaultdict(list)
|
|
||||||
postprocessors = self.extractor.config_accumulate("postprocessors")
|
postprocessors = self.extractor.config_accumulate("postprocessors")
|
||||||
if postprocessors:
|
if postprocessors:
|
||||||
|
self.hooks = collections.defaultdict(list)
|
||||||
pp_log = self.get_logger("postprocessor")
|
pp_log = self.get_logger("postprocessor")
|
||||||
pp_list = []
|
pp_list = []
|
||||||
category = self.extractor.category
|
category = self.extractor.category
|
||||||
|
|||||||
Reference in New Issue
Block a user