btel / SpikeSort

Spike sorting library implemented in Python/NumPy/PyTables
http://spike-sort.readthedocs.org
Other
27 stars 12 forks source link

HasAttribute in base.py catches ALL exceptions #62

Closed btel closed 12 years ago

btel commented 12 years ago

Assertion base.HasAttribute catches exceptions making it impossible to debug the components depending on it.For example, if the attribute is a property and getter or setter has a bug that generates an exception, the exception is silently passed.

This behaviour is probably due to the way that hasattr is implemented (it uses getattr and catches the exception: http://docs.python.org/library/functions.html#hasattr).

The call to hasattr should be replaced by getattr and try... except... block

belevtsoff commented 12 years ago

hell yeah