py: query: avoid assert triggering on None family
lib.getFileFamily() returns None for many files. Our assert to ensure the family is valid should only be done once we have checked the family is NOT None. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
This commit is contained in:
parent
6c9decb84b
commit
56156027f1
1 changed files with 2 additions and 1 deletions
|
|
@ -173,9 +173,10 @@ class Query:
|
|||
|
||||
filename = os.path.basename(path)
|
||||
family = lib.getFileFamily(filename)
|
||||
assert family in lib.CACHED_DEFINITIONS_FAMILIES, f"family {family} must have its definitions cached"
|
||||
|
||||
if family != None:
|
||||
assert family in lib.CACHED_DEFINITIONS_FAMILIES, f"family {family} must have its definitions cached"
|
||||
|
||||
buffer = BytesIO()
|
||||
tokens = self.scriptLines('tokenize-file', version, path, family)
|
||||
even = True
|
||||
|
|
|
|||
Loading…
Reference in a new issue