Fix usage of callable_deprecation on LazyObject that was breaking CW 3.24 (or something like that)
Compare changes
So, brace yourself, it's a little bit complicated (don't hesitate to reach me for more explanation).
So, it goes like that:
@wraps
decorator from functools.wraps in logilab.common.deprecation.callable_deprecated because this is a good practiceexists = LazyObject("os.path", "exists")
and up until exists
is used, the import is not triggeredNow, why is it a problem? Well ...
functools.@wraps
actually try to access a bunch of attributes on the wrapped callable to grab __name__
, 'dict, '__doc__
to avoid breaking a bunch of stufffunctools.@wraps
triggers the import of those objectsSo, this MR:
I think it's the first time I had to debug one exception that triggered 3-4 other exceptions ^^'
Also protip: uses pdbpp instead of pdb, it allows to access hidden frames.