From 801b8a1e59ddb0cf51fafa49058696d143932839 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 21 Mar 2019 15:05:04 +0100 Subject: [PATCH] prevent ZeroDivisionError --- passbook/core/policies.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passbook/core/policies.py b/passbook/core/policies.py index 301c7b057..e495f018e 100644 --- a/passbook/core/policies.py +++ b/passbook/core/policies.py @@ -91,12 +91,12 @@ class PolicyEngine: kwargs=kwargs, time_limit=policy.timeout)) self.__get_timeout += policy.timeout - self.__get_timeout += 3 - self.__get_timeout = (self.__get_timeout / len(self.policies)) * 1.5 LOGGER.debug("Set total policy timeout to %r", self.__get_timeout) # If all policies are cached, we have an empty list here. if signatures: self.__group = group(signatures)() + self.__get_timeout += 3 + self.__get_timeout = (self.__get_timeout / len(self.policies)) * 1.5 self.__cached = cached_policies return self