From 4ae28f6dbf355a8e53dbcaa7743ad46251be0d0a Mon Sep 17 00:00:00 2001 From: Yovarni Yearwood Date: Sat, 21 Sep 2019 14:48:03 -0400 Subject: [PATCH] Fixed sandwich variable not being assigned Added try-except for post-processing failed comics when sandwich was not defined by current parameters. UnboundLocalError: local variable 'sandwich' referenced before assignment --- mylar/Failed.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mylar/Failed.py b/mylar/Failed.py index 66358c82..29e72706 100644 --- a/mylar/Failed.py +++ b/mylar/Failed.py @@ -170,15 +170,21 @@ class FailedProcessor(object): sandwich = issueid elif 'G' in issueid or '-' in issueid: sandwich = 1 - if helpers.is_number(sandwich): - if sandwich < 900000: + try: + if helpers.is_number(sandwich): + if sandwich < 900000: # if sandwich is less than 900000 it's a normal watchlist download. Bypass. - pass - else: - logger.info('Failed download handling for story-arcs and one-off\'s are not supported yet. Be patient!') - self._log(' Unable to locate downloaded file to rename. PostProcessing aborted.') + pass + else: + logger.info('Failed download handling for story-arcs and one-off\'s are not supported yet. Be patient!') + self._log(' Unable to locate downloaded file to rename. PostProcessing aborted.') + self.valreturn.append({"self.log": self.log, + "mode": 'stop'}) + return self.queue.put(self.valreturn) + except NameError: + logger.info('sandwich was not defined. Post-processing aborted...') self.valreturn.append({"self.log": self.log, - "mode": 'stop'}) + "mode": 'stop'}) return self.queue.put(self.valreturn)