]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Add support for parametrizable __str__ in DNSException.
authorPetr Spacek <pspacek@redhat.com>
Thu, 19 Mar 2015 16:55:30 +0000 (17:55 +0100)
committerPetr Spacek <pspacek@redhat.com>
Tue, 24 Mar 2015 12:42:30 +0000 (13:42 +0100)
commitdfe8f47a98b349bbd31ea64d6ab0a7df0672a8f8
treead43e41cfee7f6e20bd8f5fff7fa384ff32797c9
parent5a51fed016330212d4a551b078fafa3dc1b1f8ce
Add support for parametrizable __str__ in DNSException.

This change makes __init__ and __str__ parametrization simpler
and keeps backward compatiblity with old code which does not use keyword
arguments in raise().

Parametrized __str__ can be implemented simply by defining "fmt" and
"supp_kwargs" class variables in particular exception class.

Doc string is used in cases where specific message parameters were not provided
during instantiation/raise.
dns/exception.py