-
-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Description
This is a question (not an issue).
I am using wrapt.ObjectProxy to modify context manager behavior (__enter__, __exit__) of a database connection object (SqlAlchemy Connection). It works as expected with the SqlAlchemy version 1.3.x, but in 1.4.47 it raises an exception in this piece of code (inspection.py, the comments are mine):
type_ = type(subject) # <--- type() is used, rather than __class__
for cls in type_.__mro__: # <--- loops over MRO types: (<class 'util.db.ConnectionProxy'>, <class 'ObjectProxy'>, <class 'object'>)
if cls in _registrars: # <--- not in
reg = _registrars[cls]
if reg is True:
return subject
ret = reg(subject)
if ret is not None:
break
else:
reg = ret = None
if raiseerr and (reg is None or ret is None):
raise exc.NoInspectionAvailable( # <--- Throws
"No inspection system is "
"available for object of type %s" % type_
)
Is there a workaround for this? Thank you.
Metadata
Metadata
Assignees
Labels
No labels