[PATCH 3 of 8 v2] cleanup: replace hasattr() usage with getattr() in hghave
Mads Kiilerich
mads at kiilerich.com
Sat May 12 13:40:51 CDT 2012
Augie Fackler wrote, On 05/12/2012 07:39 PM:
> On May 12, 2012, at 7:38 PM, Bryan O'Sullivan wrote:
>
>> On Sat, May 12, 2012 at 10:32 AM, Augie Fackler<raf at durin42.com> wrote:
>>
>>> hasattr() on Python< 3 is hopelessly broken. It catches all exception
>>> types, not just AttributeError (even KeyboardInterrupt and friends.)
>>>
>> But why not use util.safehasattr there?
> That would be better, agreed.
The test engine (including hghave) is currently completely independent
of the code it is checking. That could of course change, but I doubt it
would be worth it.
/Mads
More information about the Mercurial-devel
mailing list