Message274368
I've posted a file that runs your code as you expect.
It uses a custom Action class (like your test case). It subclasses ._SubParsersAction, and replaces the 9351 namespace use with the original one. I use the registry to change the class that parser.add_subparsers() uses.
The stock argparse.py file does not need to be changed.
ps
In your custom Action I access `namespace.foo` with `getattr(namespace, 'foo', None)` which is how argparse accesses the namespace, and does not throw attribute errors. |
|
Date |
User |
Action |
Args |
2016-09-04 16:36:55 | paul.j3 | set | recipients:
+ paul.j3, ericvw, nickpapior |
2016-09-04 16:36:55 | paul.j3 | set | messageid: <1473007015.86.0.502630230116.issue27859@psf.upfronthosting.co.za> |
2016-09-04 16:36:55 | paul.j3 | link | issue27859 messages |
2016-09-04 16:36:55 | paul.j3 | create | |
|