mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-07-07 16:59:38 +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:
7
setup.py
7
setup.py
@ -50,16 +50,13 @@ def get_pkgconfig_data(args, mod, required=True):
|
|||||||
f = os.popen(f"pkg-config {args_str} {mod}")
|
f = os.popen(f"pkg-config {args_str} {mod}")
|
||||||
|
|
||||||
line = f.readline()
|
line = f.readline()
|
||||||
if line is not None:
|
|
||||||
line = line.strip()
|
|
||||||
|
|
||||||
if line is None or line == "":
|
if line is None or line == "":
|
||||||
if required:
|
if required:
|
||||||
raise Exception(f"Cannot determine '{args_str}' from libvirt pkg-config file")
|
raise Exception(f"Cannot determine '{args_str}' from libvirt pkg-config file")
|
||||||
else:
|
else:
|
||||||
return ""
|
line = ""
|
||||||
|
return line.strip()
|
||||||
|
|
||||||
return line
|
|
||||||
|
|
||||||
def get_api_xml_files():
|
def get_api_xml_files():
|
||||||
"""Check with pkg-config that libvirt is present and extract
|
"""Check with pkg-config that libvirt is present and extract
|
||||||
|
Reference in New Issue
Block a user