Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 show_version():
"""Show PBWrapper, PKGBUILDer, pacman and pyalpm versions."""
localdb = DS.pyc.get_localdb()
pacpkg = localdb.get_pkg('pacman')
print("""PBWrapper v{0}
PKGBUILDer v{1}
pacman v{2}
pyalpm v{3}""".format(__wrapperversion__, __version__,
pacpkg.version.split('-', 1)[0],
pyalpm.version()))
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