mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
tracetool: fix usage of try_import()
try_import returns a tuple of a boolean and the requested module or attribute.
exists() functions return tracetool.try_import("tracetool.format." + name)[1]
but they should return the boolean value instead.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20250929154938.594389-2-pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
committed by
Stefan Hajnoczi
parent
29b77c1a2d
commit
50873504dc
@@ -94,7 +94,7 @@ def exists(name):
|
||||
if name == "nop":
|
||||
return True
|
||||
name = name.replace("-", "_")
|
||||
return tracetool.try_import("tracetool.backend." + name)[1]
|
||||
return tracetool.try_import("tracetool.backend." + name)[0]
|
||||
|
||||
|
||||
class Wrapper:
|
||||
|
||||
@@ -70,7 +70,7 @@ def exists(name):
|
||||
if len(name) == 0:
|
||||
return False
|
||||
name = name.replace("-", "_")
|
||||
return tracetool.try_import("tracetool.format." + name)[1]
|
||||
return tracetool.try_import("tracetool.format." + name)[0]
|
||||
|
||||
|
||||
def generate(events, format, backend, group):
|
||||
|
||||
Reference in New Issue
Block a user