[MERGE] Bugfix: WT4.get_file_sha1 raises exception on missing files #118186

Aaron Bentley aaron.bentley at utoronto.ca
Fri Jun 1 20:43:35 BST 2007


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

John Arbash Meinel wrote:
> I would typically do:
> 
> if e.errno == errno.ENOENT:
>     return None
> raise
> 
> rather than else: raise.
> 
> For me, it makes it clearer that it will raising is the default behavior.

To me, using explicit "else" makes it clearer that this is a disjunction:
either we return None, or we raise.

And since most disjunctions don't cause termination of the function in
either branch, most disjunctions must be structured as if/else.  If most
disjuctions are stuctured as if/else, it makes sense to structure all of
them as if/else.

Anyhow, thanks for the review.  Submitted.

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

iD8DBQFGYHbn0F+nu1YWqI0RAr3NAJ0a+j1v39xEqWnu6WJwlKuEa591ugCeKhFn
+wfh3ObaUXBgCy9mPP6CVwM=
=z8aC
-----END PGP SIGNATURE-----



More information about the bazaar mailing list