[MERGE] get_transport appends to possible_transports if it's an empty list

Aaron Bentley aaron.bentley at utoronto.ca
Sun Aug 19 21:46:16 BST 2007


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

Hi all,

This patch fixes get_transport's behavior when possible_transports is an
empty list.  I think if a list is supplied, whether or not it's empty,
get_transport is meant to populate it.  I believe this is a bug in
get_transport.

As you can see, the patch is to simply change "if x" to "if x is not
None".  Remember folks, don't abuse the fact that None evaluates to
False.  Test what you care about.  The empty list often means something
totaly different from None, and this gotcha comes up repeatedly.

Personally I only use "if x" for variables that are mean to have boolean
values.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGyKwY0F+nu1YWqI0RAtB+AJ4ywafRB6LUA0k1JNov9SueNjm0oQCfU9lw
69wJdej8U9JP9pT1DA0qmoM=
=lpM+
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-mail-xQ0nXo.patch
Type: text/x-patch
Size: 3626 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070819/c4061b88/attachment.bin 


More information about the bazaar mailing list