Closed chrahunt closed 5 years ago
Oooooof .... apipkg does some shenanigans with __dict__
of modules ... hunter.util.rudimentary_repr
does a hasattr(obj, '__dict__')
check 😞
A check like '__dict__' not in getattr(obj_type, '__dict__', ()) and not hasattr(obj, '__dict__')
would fix it but then that would fail too if obj_type had a god damn descriptor as __dict__
...
So there's a fix in master, give it a try.
Looks good to me!
Hunter 3.0 is released.
When referencing
py.io.TerminalWriter
(probably other attributes as well), an exception is raised only when hunter is in use. Example:No exception should appear.
When running with hunter, like
the following exception occurs:
The exception does not occur if we omit
stdlib=False
.The exception does not occur when excluding the
py._vendored_packages.apipkg
, like:Doing some debugging around the area in apipkg it looks like the act of introspecting happens at a time that causes the exception to be raised. Maybe the method is not re-entrant, but the printing would require it to be?
In case there's a fundamental issue that can't be solved, adding documentation to call this out as a limitation would be good.
Additionally, we could use some documentation on what to watch out for when debugging hunter-related issues. Even basic debugging (e.g.
breakpoint()
, pdb, intentionally raising exceptions, logging) gives confusing feedback - messages logged at the top of__makeattr
are printed twice but unconditional exceptions only visibly raised once, same with breakpoints.