don't say "assert False"

Martin Pool mbp at sourcefrog.net
Fri Mar 30 07:10:27 BST 2007


The hpss code in remote.py, when it doesn't know what else to do, tends to say

  assert False, "something bad happened"

This is not a good idea because if run with python -O this will just
pass, typically causing the Remote method to return None.  Use

  raise AssertionError

or ProtocolError, NotImplementedError, or something more specific.

-- 
Martin



More information about the bazaar mailing list