]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-116850: Fix argparse for namespaces with not directly writable dict (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 7 Oct 2024 21:27:11 +0000 (23:27 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Oct 2024 21:27:11 +0000 (00:27 +0300)
commit11d4b54b88063efbeb8968263dfa77dcfb816f8c
treecee4e92f6a84755713350c73775f761d49d60c2a
parent597b6211ab6ddbf1bc5bdf15d404c1a9a94d04af
[3.13] gh-116850: Fix argparse for namespaces with not directly writable dict (GH-124667) (GH-124757)

It now always uses setattr() instead of setting the dict item to modify
the namespace. This allows to use a class as a namespace.
(cherry picked from commit 95e92ef6c74e973ea13d15180190d0fa2af82fbf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2024-09-27-15-16-04.gh-issue-116850.dBkR0-.rst [new file with mode: 0644]