Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_alpm_version():
assert pyalpm.alpmversion() != ''
def check_pyalpm_version():
""" Checks python alpm binding and alpm library versions """
try:
import pyalpm
txt = _("Using pyalpm v{0} as interface to libalpm v{1}")
txt = txt.format(pyalpm.version(), pyalpm.alpmversion())
logging.info(txt)
except (NameError, ImportError) as err:
logging.error(err)
sys.exit(1)
return True
def check_pyalpm_version():
""" Checks python alpm binding and alpm library versions """
try:
import pyalpm
txt = "Using pyalpm v{0} as interface to libalpm v{1}"
txt = txt.format(pyalpm.version(), pyalpm.alpmversion())
logging.info(txt)
except (NameError, ImportError) as err:
try:
show.error(None, err)
logging.error(err)
except ImportError as import_error:
logging.error(import_error)
return False
return True
def main(args):
print(VERSION_STRING % (pyalpm.version(), pyalpm.alpmversion()))
return 2
def check_pyalpm_version():
""" Checks python alpm binding and alpm library versions """
try:
import pyalpm
txt = "Using pyalpm v{0} as interface to libalpm v{1}"
txt = txt.format(pyalpm.version(), pyalpm.alpmversion())
logging.info(txt)
except (NameError, ImportError) as err:
try:
import show_message as show
show.error(None, err)
except ImportError as import_error:
logging.error(import_error)
finally:
logging.error(err)
return False
return True