Skip to content

Commit 5acb2d0

Browse files
Add BaseMeta helper for pypy
1 parent 569e811 commit 5acb2d0

File tree

1 file changed

+7
-3
lines changed
  • instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi

1 file changed

+7
-3
lines changed

instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/proxy.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
# limitations under the License.
1414

1515

16-
from abc import ABC, abstractmethod
16+
from abc import ABC, ABCMeta, abstractmethod
1717

1818
import wrapt
1919

2020

21-
class BaseTracedConnectionProxy(ABC, wrapt.ObjectProxy):
21+
class BaseMeta(ABCMeta, type(wrapt.ObjectProxy)):
22+
"""Metaclass compatibility helper for PyPy for derived classes"""
23+
24+
25+
class BaseTracedConnectionProxy(ABC, wrapt.ObjectProxy, metaclass=BaseMeta):
2226
"""ABC for traced database client connection proxy.
2327
2428
Child classes are used to wrap Connection objects and
@@ -54,7 +58,7 @@ def __exit__(self, *args, **kwargs):
5458

5559

5660
# pylint: disable=abstract-method
57-
class BaseTracedCursorProxy(ABC, wrapt.ObjectProxy):
61+
class BaseTracedCursorProxy(ABC, wrapt.ObjectProxy, metaclass=BaseMeta):
5862
"""ABC for traced database client cursor proxy.
5963
6064
Child classes are used to wrap Cursor objects and

0 commit comments

Comments
 (0)