Skip to content

Commit

Permalink
Drop superfluous 'global' statements from command.py (#621)
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 authored May 25, 2024
1 parent db84706 commit 5ff4911
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 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 @@ -387,8 +384,6 @@ def create_subparser(parser, cmd_name, verb_extensions, *, attribute):
selected verb
:returns: The special action object
"""
global colcon_logger

# list of available verbs with their descriptions
verbs = []
for name, extension in verb_extensions.items():
Expand Down

0 comments on commit 5ff4911

Please sign in to comment.