1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-06 12:59:32 +03:00

setup: Simplify get_pkgconfig_data

We don't need to do both None/non-None checks on the returned string.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Erik Skultety
2023-06-07 17:15:52 +02:00
parent e749b4cf11
commit cd936c1f8a

View File

@ -50,16 +50,13 @@ def get_pkgconfig_data(args, mod, required=True):
f = os.popen(f"pkg-config {args_str} {mod}")
line = f.readline()
if line is not None:
line = line.strip()
if line is None or line == "":
if required:
raise Exception(f"Cannot determine '{args_str}' from libvirt pkg-config file")
else:
return ""
line = ""
return line.strip()
return line
def get_api_xml_files():
"""Check with pkg-config that libvirt is present and extract