Skip to content

Commit a7c31cb

Browse files
authored
argparse uses repr on the choices when throwing an error, which causes our u-prefixed string literals to print out with the prefix when running the code42cli on python2: (#14)
``` # code42 securitydata notvalid usage: code42 securitydata [-h] {send-to,write-to,print,clear-checkpoint} ... code42 securitydata: error: invalid choice: 'notvalid' (choose from 'send-to', u'write-to', u'print', 'clear-checkpoint') ``` So I'm removing those from the relevant strings.
1 parent 9557581 commit a7c31cb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/code42cli/profile/profile.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ def init(subcommand_parser):
2626
Args:
2727
subcommand_parser: The subparsers group created by the parent parser.
2828
"""
29-
parser_profile = subcommand_parser.add_parser(u"profile")
29+
parser_profile = subcommand_parser.add_parser("profile")
3030
parser_profile.set_defaults(func=show_profile)
3131
profile_subparsers = parser_profile.add_subparsers()
3232

33-
parser_for_show_command = profile_subparsers.add_parser(u"show")
34-
parser_for_set_command = profile_subparsers.add_parser(u"set")
35-
parser_for_reset_password = profile_subparsers.add_parser(u"reset-pw")
33+
parser_for_show_command = profile_subparsers.add_parser("show")
34+
parser_for_set_command = profile_subparsers.add_parser("set")
35+
parser_for_reset_password = profile_subparsers.add_parser("reset-pw")
3636

3737
parser_for_show_command.set_defaults(func=show_profile)
3838
parser_for_set_command.set_defaults(func=set_profile)

src/code42cli/securitydata/subcommands/print_out.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def init(subcommand_parser):
1010
Args:
1111
subcommand_parser: The subparsers group created by the parent parser.
1212
"""
13-
parser = subcommand_parser.add_parser(u"print")
13+
parser = subcommand_parser.add_parser("print")
1414
parser.set_defaults(func=print_out)
1515
search_args.add_arguments_to_parser(parser)
1616
main_args.add_arguments_to_parser(parser)

src/code42cli/securitydata/subcommands/write_to.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def init(subcommand_parser):
1010
Args:
1111
subcommand_parser: The subparsers group created by the parent parser.
1212
"""
13-
parser = subcommand_parser.add_parser(u"write-to")
13+
parser = subcommand_parser.add_parser("write-to")
1414
parser.set_defaults(func=write_to)
1515
_add_filename_subcommand(parser)
1616
search_args.add_arguments_to_parser(parser)

0 commit comments

Comments
 (0)