Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix check_supplements assert error #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions panoramix/utils/supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from zipfile import ZipFile
from typing import Optional
import shelve
import dbm
from panoramix.utils.helpers import (
cache_dir,
cached,
Expand Down Expand Up @@ -47,7 +48,7 @@ def abi_path():


def check_supplements():
if not abi_path().is_file():
if not dbm.whichdb(str(abi_path())):
compressed_supplements = Path(__file__).parent.parent / "data" / "abi_dump.xz"
logger.info("Loading %s into %s...", compressed_supplements, abi_path())
with lzma.open(compressed_supplements) as inf, shelve.open(
Expand All @@ -58,7 +59,7 @@ def check_supplements():
selector, abi = line["selector"], line["abi"]
out[selector] = abi

assert abi_path().is_file()
assert dbm.whichdb(str(abi_path()))

logger.info("%s is ready.", abi_path())

Expand Down