[MERGE] make run_bzr stricter about which keyword arguments it takes
Michael Hudson
michael.hudson at canonical.com
Wed Aug 1 16:39:56 BST 2007
John Arbash Meinel wrote:
> Michael Hudson wrote:
>> I had a very minor boggle when writing my last patch because run_bzr
>> happily accepts and ignores any keyword arguments it doesn't know about
>> (then I found out about run_bzr_error). This bundle adds a check that
>> no unknown arguments were passed, and also fixed the docstring of
>> run_bzr_error to not use deprecated arguments style while I was there.
>
>> Cheers,
>> mwh
>
>
> BB:tweak
Did BB notice this?
>
> I think it would be better to do:
>
> if kwargs:
> raise TypeError("run_bzr() got unexpected keyword argument(s)"
> " %s" % (kwargs.keys(),))
>
> I realize that isn't what python does. But why not be more helpful and notice
> everything wrong in one pass, rather than 2.
Fair enough. Update attached.
Cheers,
mwh
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stricter-run_bzr-2.bundle
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070801/fcf025ba/attachment-0001.diff
More information about the bazaar
mailing list