|
From: Michael F. <fuz...@vo...> - 2008-02-27 13:50:51
|
Matt Nordhoff wrote: > 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. > Is the current use of hasattr *actually* causing any problems - or is it to avoid potential problems? I can see any problem with the patch though... (not likely to be a new release *soon* but can apply to SVN). Michael Foord http://www.manning.com/foord > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop |