Skip to content

'NoneType' object has no attribute 'autogenerate' #1089

Discussion options

You must be logged in to vote

Found the reason

lib/python/3.10/argparse.py

    def parse_known_args(self, args=None, namespace=None):
        if args is None:
            # args default to the system args
            args = _sys.argv[1:]
        else:
            # make sure that args are mutable
            args = list(args)
        ###

This will work

namespace = CommandLine().parser.parse_args(["revision", "--autogenerate"]) # now it's a list[str]

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Corfucinas
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zzzeek
Comment options

Answer selected by Corfucinas
Comment options

You must be logged in to vote
1 reply
@zzzeek
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1088 on September 22, 2022 17:10.