Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
installed_version = None
if package_name == 'frida':
import frida
installed_version = frida.__version__
elif package_name == 'capstone':
import capstone
installed_version = capstone.__version__
elif package_name == 'requests':
import requests
installed_version = requests.__version__
elif package_name == 'pyqt5':
from PyQt5 import QtCore
installed_version = QtCore.PYQT_VERSION_STR
elif package_name == 'pyperclip':
import pyperclip
installed_version = pyperclip.__version__
if installed_version is not None:
installed_version = installed_version.split('.')
_min_version = min_version.split('.')
needs_update = False
if int(installed_version[0]) < int(_min_version[0]):
needs_update = True
elif (int(installed_version[0]) <= int(_min_version[0])) and (
int(installed_version[1]) < int(_min_version[1])):
needs_update = True
elif (int(installed_version[1]) <= int(_min_version[1])) and (
int(installed_version[2]) < int(_min_version[2])):
needs_update = True
if needs_update:
print('updating ' + package_name + '... to ' + min_version)
if pip_install_package(package_name + '>=' + min_version):