From: Jakub Kicinski Date: Thu, 23 Feb 2023 18:31:40 +0000 (-0800) Subject: tools: ynl-gen: re-raise the exception instead of printing X-Git-Tag: v6.6.17~5406^2~15^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9d3a3e4ae0cb7c443d46ffe413e17749baab3ba;p=platform%2Fkernel%2Flinux-rpi.git tools: ynl-gen: re-raise the exception instead of printing traceback.print_exception() seems tricky to call, we're missing some argument, so re-raise instead. Reported-by: Chuck Lever III Fixes: 3aacf8281336 ("tools: ynl: add an object hierarchy to represent parsed spec") Signed-off-by: Jakub Kicinski --- diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py index e204679..71da568 100644 --- a/tools/net/ynl/lib/nlspec.py +++ b/tools/net/ynl/lib/nlspec.py @@ -3,7 +3,6 @@ import collections import importlib import os -import traceback import yaml @@ -234,8 +233,7 @@ class SpecFamily(SpecElement): 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)