From 169c42b7c4d9311030f027528e4b13307e1c4688 Mon Sep 17 00:00:00 2001 From: davidovski Date: Thu, 13 Jan 2022 20:03:32 +0000 Subject: fixed issue with divide by 0 --- src/verbs/sync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/verbs/sync.py') diff --git a/src/verbs/sync.py b/src/verbs/sync.py index 70adcd1..5559fcb 100644 --- a/src/verbs/sync.py +++ b/src/verbs/sync.py @@ -3,6 +3,7 @@ import util import colors import shutil import time +import sys CACHE_DIR = "/var/cache/xipkg" @@ -16,7 +17,10 @@ def list_packages(url): if status != 200: return {}, -1 else: - duration /= len(response) + if len(response) > 0: + duration /= len(response) + else: + duration = float('inf') return { line.split()[0].split(".")[0]: " ".join(line.split()[1:]) for line in response.split("\n") if len(line.split()) > 0 -- cgit v1.2.1