Skip to content

Commit

Permalink
Add BaseMeta helper for pypy
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi committed Nov 19, 2024
1 parent 569e811 commit 5acb2d0
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
# limitations under the License.


from abc import ABC, abstractmethod
from abc import ABC, ABCMeta, abstractmethod

import wrapt


class BaseTracedConnectionProxy(ABC, wrapt.ObjectProxy):
class BaseMeta(ABCMeta, type(wrapt.ObjectProxy)):
"""Metaclass compatibility helper for PyPy for derived classes"""


class BaseTracedConnectionProxy(ABC, wrapt.ObjectProxy, metaclass=BaseMeta):
"""ABC for traced database client connection proxy.
Child classes are used to wrap Connection objects and
Expand Down Expand Up @@ -54,7 +58,7 @@ def __exit__(self, *args, **kwargs):


# pylint: disable=abstract-method
class BaseTracedCursorProxy(ABC, wrapt.ObjectProxy):
class BaseTracedCursorProxy(ABC, wrapt.ObjectProxy, metaclass=BaseMeta):
"""ABC for traced database client cursor proxy.
Child classes are used to wrap Cursor objects and
Expand Down

0 comments on commit 5acb2d0

Please sign in to comment.