mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 00:46:01 +03:00
Replace RuntimeError by SystemExit.
This commit is contained in:
12
gns3/main.py
12
gns3/main.py
@@ -37,7 +37,7 @@ import argparse
|
||||
try:
|
||||
from gns3.qt import QtCore, QtGui, QtWidgets, DEFAULT_BINDING
|
||||
except ImportError:
|
||||
raise RuntimeError("Can't import Qt modules: Qt and/or PyQt is probably not installed correctly...")
|
||||
raise SystemExit("Can't import Qt modules: Qt and/or PyQt is probably not installed correctly...")
|
||||
from gns3.main_window import MainWindow
|
||||
|
||||
from gns3.logger import init_logger
|
||||
@@ -142,20 +142,20 @@ def main():
|
||||
|
||||
# we only support Python 3 version >= 3.4
|
||||
if sys.version_info < (3, 4):
|
||||
raise RuntimeError("Python 3.4 or higher is required")
|
||||
raise SystemExit("Python 3.4 or higher is required")
|
||||
|
||||
def version(version_string):
|
||||
return [int(i) for i in version_string.split('.')]
|
||||
|
||||
if version(QtCore.QT_VERSION_STR) < version("4.6"):
|
||||
raise RuntimeError("Requirement is Qt version 4.6 or higher, got version {}".format(QtCore.QT_VERSION_STR))
|
||||
raise SystemExit("Requirement is Qt version 4.6 or higher, got version {}".format(QtCore.QT_VERSION_STR))
|
||||
|
||||
# 4.8.3 because of QSettings (http://pyqt.sourceforge.net/Docs/PyQt4/pyqt_qsettings.html)
|
||||
if DEFAULT_BINDING == "PyQt4" and version(QtCore.BINDING_VERSION_STR) < version("4.8.3"):
|
||||
raise RuntimeError("Requirement is PyQt version 4.8.3 or higher, got version {}".format(QtCore.BINDING_VERSION_STR))
|
||||
raise SystemExit("Requirement is PyQt version 4.8.3 or higher, got version {}".format(QtCore.BINDING_VERSION_STR))
|
||||
|
||||
if DEFAULT_BINDING == "PyQt5" and version(QtCore.BINDING_VERSION_STR) < version("5.0.0"):
|
||||
raise RuntimeError("Requirement is PyQt5 version 5.0.0 or higher, got version {}".format(QtCore.BINDING_VERSION_STR))
|
||||
raise SystemExit("Requirement is PyQt5 version 5.0.0 or higher, got version {}".format(QtCore.BINDING_VERSION_STR))
|
||||
|
||||
# check for the correct locale
|
||||
# (UNIX/Linux only)
|
||||
@@ -177,7 +177,7 @@ def main():
|
||||
import win32con
|
||||
import win32gui
|
||||
except ImportError:
|
||||
raise RuntimeError("Python for Windows extensions must be installed.")
|
||||
raise SystemExit("Python for Windows extensions must be installed.")
|
||||
|
||||
if not options.debug:
|
||||
try:
|
||||
|
||||
@@ -55,7 +55,7 @@ if DEFAULT_BINDING == 'PyQt5':
|
||||
from PyQt5 import QtSvg
|
||||
sys.modules[__name__ + '.QtSvg'] = QtSvg
|
||||
except ImportError:
|
||||
raise RuntimeError("Please install the PyQt5.QtSvg module")
|
||||
raise SystemExit("Please install the PyQt5.QtSvg module")
|
||||
|
||||
try:
|
||||
from PyQt5 import QtWebKit
|
||||
|
||||
@@ -113,7 +113,7 @@ def recursive(function, path):
|
||||
if __name__ == '__main__':
|
||||
|
||||
if not PYUIC or not PYRCC:
|
||||
raise RuntimeError("pyuic5 or pyrcc5 could't be found, please install PyQt5 development tools (e.g. pyqt5-dev-tools)")
|
||||
raise SystemExit("pyuic5 or pyrcc5 could't be found, please install PyQt5 development tools (e.g. pyqt5-dev-tools)")
|
||||
|
||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||
gns3_path = os.path.abspath(os.path.join(cwd, "../gns3/"))
|
||||
|
||||
Reference in New Issue
Block a user