Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tensorboard/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def configure(self, argv=('',), **kwargs):
description=('TensorBoard is a suite of web applications for '
'inspecting and understanding your TensorFlow runs '
'and graphs. https://github.com/tensorflow/tensorboard '))
base_parser.set_defaults(**{_SUBCOMMAND_FLAG: _SERVE_SUBCOMMAND_NAME})
subparsers = base_parser.add_subparsers(
help="TensorBoard subcommand (defaults to %r)" % _SERVE_SUBCOMMAND_NAME)

Expand Down Expand Up @@ -208,6 +207,11 @@ def configure(self, argv=('',), **kwargs):

with argparse_util.allow_missing_subcommand():
flags = base_parser.parse_args(argv[1:]) # Strip binary name from argv.
if getattr(flags, _SUBCOMMAND_FLAG, None) is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth adding a TODO/note here so we can revert after we drop support for old python?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

# Manually assign default value rather than using `set_defaults`
# on the base parser to work around Python bug #9351 on old
# versions of `argparse`: <https://bugs.python.org/issue9351>
setattr(flags, _SUBCOMMAND_FLAG, _SERVE_SUBCOMMAND_NAME)

self.cache_key = manager.cache_key(
working_directory=os.getcwd(),
Expand Down