From c5baf7a203252bf0e184c5f1737e34544efbceec Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 22 Feb 2024 10:05:51 -0600 Subject: [PATCH] Drop superfluous 'global' statements from command.py I don't see any reason that these statements should be necessary and find their presence confusing. --- colcon_core/command.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/colcon_core/command.py b/colcon_core/command.py index 07dddaf1c..f706e22f6 100644 --- a/colcon_core/command.py +++ b/colcon_core/command.py @@ -86,7 +86,6 @@ def register_command_exit_handler(handler): :param handler: The callable """ - global _command_exit_handlers if handler not in _command_exit_handlers: _command_exit_handlers.append(handler) @@ -113,7 +112,6 @@ def main(*, command_name='colcon', argv=None): :param list argv: The list of arguments :returns: The return code """ - global _command_exit_handlers try: return _main(command_name=command_name, argv=argv) except KeyboardInterrupt: @@ -126,7 +124,6 @@ def main(*, command_name='colcon', argv=None): def _main(*, command_name, argv): - global colcon_logger # default log level, for searchability: COLCON_LOG_LEVEL colcon_logger.setLevel(logging.WARNING) set_logger_level_from_env( @@ -375,7 +372,6 @@ def create_subparser(parser, cmd_name, verb_extensions, *, attribute): selected verb :returns: The special action object """ - global colcon_logger assert verb_extensions, 'No verb extensions' # list of available verbs with their descriptions