diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2016-06-27 12:47:03 +0300 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@qt.io> | 2016-08-23 06:42:22 +0000 |
commit | baae999b069e61a5bfacce1fdbb9b4eb92b95347 (patch) | |
tree | d58af17bde39a9599c788389a09aa501c1ad09d7 /packaging-tools/bld_module.py | |
parent | 50a999bb31edf393a649ca8fbb63dc7c8023c871 (diff) |
Raise exception instead of using sys.exit
The sys.exit terminates just the current thread. This is an issue
if using the threadedwork.py with multiple threads as any failure
should terminate the whole script.
Change-Id: I9926c4cf9c6754a5182d331dae5a2e66c5ff95b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'packaging-tools/bld_module.py')
-rwxr-xr-x | packaging-tools/bld_module.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packaging-tools/bld_module.py b/packaging-tools/bld_module.py index 4d18ffa0a..1f38a3467 100755 --- a/packaging-tools/bld_module.py +++ b/packaging-tools/bld_module.py @@ -236,7 +236,7 @@ if not os.path.lexists(callerArguments.qt5path) and not callerArguments.qt5_modu parser.print_help() print(("error: Please add the missing qt5_module_url arguments if the {0} does not exist" + os.linesep + os.linesep).format(callerArguments.qt5path)) - sys.exit(1) + raise RuntimeError() qmakeBinary = os.path.abspath(os.path.join(callerArguments.qt5path, 'bin', 'qmake')) @@ -315,13 +315,13 @@ runCommand(generateCommand, currentWorkingDirectory = qtModuleBuildDirectory, ret = runBuildCommand(currentWorkingDirectory = qtModuleBuildDirectory, callerArguments = callerArguments) if ret: - sys.exit('Failure running the last command: %i' % ret) + raise RuntimeError('Failure running the last command: %i' % ret) ret = runInstallCommand(['install', 'INSTALL_ROOT=' + qtModuleInstallDirectory], currentWorkingDirectory = qtModuleBuildDirectory, callerArguments = callerArguments, init_environment = environment) if ret: - sys.exit('Failure running the last command: %i' % ret) + raise RuntimeError('Failure running the last command: %i' % ret) # patch .so filenames on Windows/Android if bldinstallercommon.is_win_platform() and os.environ.get('DO_PATCH_ANDROID_SONAME_FILES'): @@ -342,13 +342,13 @@ if callerArguments.makeDocs: currentWorkingDirectory = qtModuleBuildDirectory, callerArguments = callerArguments, init_environment = environment) if ret: - sys.exit('Failure running the last command: %i' % ret) + raise RuntimeError('Failure running the last command: %i' % ret) # then make install those ret = runInstallCommand(['install_docs', 'INSTALL_ROOT=' + qtModuleInstallDirectory], currentWorkingDirectory = qtModuleBuildDirectory, callerArguments = callerArguments, init_environment = environment) if ret: - sys.exit('Failure running the last command: %i' % ret) + raise RuntimeError('Failure running the last command: %i' % ret) # make separate "doc.7z" for later use if needed doc_dir = bldinstallercommon.locate_directory(qtModuleInstallDirectory, 'doc') if doc_dir: @@ -356,7 +356,7 @@ if callerArguments.makeDocs: ret = runCommand(['7z', 'a', os.path.join('doc_archives', archive_name), doc_dir], currentWorkingDirectory = os.path.dirname(os.path.realpath(__file__))) if ret: - sys.exit('Failure running the last command: %i' % ret) + raise RuntimeError('Failure running the last command: %i' % ret) # try to figure out where the actual exported content is qt5_install_basename = os.path.basename(callerArguments.qt5path) @@ -381,4 +381,4 @@ else: archive_cmd.append(dir_to_archive) ret = runCommand(archive_cmd, currentWorkingDirectory = os.path.dirname(os.path.realpath(__file__))) if ret: - sys.exit('Failure running the last command: %i' % ret) + raise RuntimeError('Failure running the last command: %i' % ret) |