|
From: Matt N. <mno...@ma...> - 2008-02-27 08:12:27
|
Hi. Python's hasattr() function swallows all exceptions, including things like KeyboardInterrupt. Therefore, one project I tinker on (Bazaar) uses "getattr(object, 'attribute', None) is not None" instead. Here's a patch to change that in ConfigObj (and pathutils). Of course, that is subtly different, so you should verify it's ok. I didn't run ConfigObj's test suite (unless it has no output and takes 1 second, in which case I did), but I did run Bazaar's test suite with this change and nothing broke. -- |