prevent ZeroDivisionError

This commit is contained in:
Jens Langhammer 2019-03-21 15:05:04 +01:00
parent 3a52059793
commit 801b8a1e59

View file

@ -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