[MERGE] make run_bzr stricter about which keyword arguments it takes

John Arbash Meinel john at arbash-meinel.com
Wed Aug 1 15:48:05 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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


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.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsJ0lJdeBCYSNAAMRAreOAJ4lH1ED/Bsqw3+hxP1nMKIUR6K2rgCgvfMf
tIAfTe0B1bGIfI6xHui5HwA=
=4nG8
-----END PGP SIGNATURE-----



More information about the bazaar mailing list