]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-116850: Fix argparse for namespaces with not directly writable dict (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 29 Sep 2024 08:40:00 +0000 (10:40 +0200)
committerGitHub <noreply@github.com>
Sun, 29 Sep 2024 08:40:00 +0000 (08:40 +0000)
commit5464c8aa9856a65f576f536532ee56310397e109
treeb61c81772c72d107bdd89a77a3dc72c6abda94ec
parent7677be5ee6ffdc7b4b366ea29a86da50873cd731
[3.12] gh-116850: Fix argparse for namespaces with not directly writable dict (GH-124667) (GH-124758)

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]