diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 3f2903d1..6ffb0973 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -123,7 +123,9 @@ def get_all_icon_dirs(repodir): def disabled_algorithms_allowed(): - return options.allow_disabled_algorithms or config['allow_disabled_algorithms'] + return ((options is not None and options.allow_disabled_algorithms) + or (config is not None and config['allow_disabled_algorithms']) + or common.default_config['allow_disabled_algorithms']) def status_update_json(apps, apks): @@ -521,7 +523,7 @@ def get_cache(): """ apkcachefile = get_cache_file() ada = disabled_algorithms_allowed() - if not options.clean and os.path.exists(apkcachefile): + if options is not None and not options.clean and os.path.exists(apkcachefile): with open(apkcachefile) as fp: apkcache = json.load(fp, object_pairs_hook=collections.OrderedDict) if apkcache.get("METADATA_VERSION") != METADATA_VERSION \ @@ -1778,7 +1780,7 @@ def process_apks(apkcache, repodir, knownapks, use_date_from_apk=False): for icon_dir in get_all_icon_dirs(repodir): if os.path.exists(icon_dir): - if options.clean: + if options is not None and options.clean: shutil.rmtree(icon_dir) os.makedirs(icon_dir) else: