Skip to content

Commit

Permalink
Drop superfluous 'global' statements from command.py
Browse files Browse the repository at this point in the history
I don't see any reason that these statements should be necessary and
find their presence confusing.
  • Loading branch information
cottsay committed Feb 22, 2024
1 parent ee44262 commit c5baf7a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions colcon_core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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:
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c5baf7a

Please sign in to comment.