Skip to content

Commit

Permalink
tools: ynl-gen: re-raise the exception instead of printing
Browse files Browse the repository at this point in the history
traceback.print_exception() seems tricky to call, we're missing
some argument, so re-raise instead.

Reported-by: Chuck Lever III <chuck.lever@oracle.com>
Fixes: 3aacf82 ("tools: ynl: add an object hierarchy to represent parsed spec")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
kuba-moo committed Feb 24, 2023
1 parent f7cf644 commit b9d3a3e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/net/ynl/lib/nlspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import collections
import importlib
import os
import traceback
import yaml


Expand Down Expand Up @@ -234,8 +233,7 @@ def __init__(self, spec_path, schema_path=None):
resolved.append(elem)

if len(resolved) == 0:
traceback.print_exception(last_exception)
raise Exception("Could not resolve any spec element, infinite loop?")
raise last_exception

def new_attr_set(self, elem):
return SpecAttrSet(self, elem)
Expand Down

0 comments on commit b9d3a3e

Please sign in to comment.