From 15592ec4f7dcf42c529b99eda2a7ec2520d5a431 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Thu, 17 Jun 2021 20:37:04 +0200 Subject: [PATCH] corelib: update debug_script to python 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This script was written for Python 2, which is deprecated now. Change-Id: I534c93922776254a4c822ac60c6fd77ca7cb9760 Reviewed-by: Edward Welbourne Reviewed-by: Tor Arne Vestbø Reviewed-by: hjk --- src/corelib/debug_script.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/debug_script.py b/src/corelib/debug_script.py index 9111213ef7..7aaa1a79d1 100644 --- a/src/corelib/debug_script.py +++ b/src/corelib/debug_script.py @@ -34,7 +34,7 @@ from distutils.version import LooseVersion MODULE_NAME = 'qt' -def import_bridge(path, debugger, session_dict, reload_module = False): +def import_bridge(path, debugger, session_dict, reload_module=False): if not reload_module and MODULE_NAME in sys.modules: del sys.modules[MODULE_NAME] @@ -58,8 +58,8 @@ def import_bridge(path, debugger, session_dict, reload_module = False): return bridge def report_success(bridge): - print "Using Qt summary providers from Creator %s in '%s'" \ - % (bridge.CREATOR_VERSION, bridge.CREATOR_PATH) + print("Using Qt summary providers from Creator {} in '{}'".format( + bridge.CREATOR_VERSION, bridge.CREATOR_PATH)) def __lldb_init_module(debugger, session_dict): # Check if the module has already been imported globally. This ensures @@ -87,7 +87,7 @@ def __lldb_init_module(debugger, session_dict): for version in sorted(versions, key=LooseVersion, reverse=True): path = versions[version] - bridge_path = path + '/Contents/Resources/debugger/lldbbridge.py' + bridge_path = '{}/Contents/Resources/debugger/lldbbridge.py'.format(path) bridge = import_bridge(bridge_path, debugger, session_dict) if bridge: bridge.CREATOR_VERSION = version @@ -95,4 +95,4 @@ def __lldb_init_module(debugger, session_dict): report_success(bridge) return - print "Could not find Qt Creator installation, no Qt summary providers installed" + print("Could not find Qt Creator installation, no Qt summary providers installed")