Skip to content

Commit 5454858

Browse files
committed
MPT-12874 Fix unplanned recursion on MPTClient with commerce
1 parent de70be9 commit 5454858

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mpt_api_client/mptclient.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
from abc import ABC
2+
13
from mpt_api_client.http.client import HTTPClient
24
from mpt_api_client.registry import Registry, commerce
35
from mpt_api_client.resources import OrderCollectionClient
46

57

6-
class MPTClient:
7-
"""MPT API Client."""
8+
class MPTClientBase(ABC): # noqa: B024
9+
"""MPT API Client Base."""
810

911
def __init__(
1012
self,
@@ -19,6 +21,10 @@ def __init__(
1921
def __getattr__(self, name): # type: ignore[no-untyped-def]
2022
return self.registry.get(name)(client=self.mpt_client)
2123

24+
25+
class MPTClient(MPTClientBase):
26+
"""MPT API Client."""
27+
2228
@property
2329
def commerce(self) -> "CommerceMpt":
2430
"""Commerce MPT API Client.
@@ -30,7 +36,7 @@ def commerce(self) -> "CommerceMpt":
3036
return CommerceMpt(mpt_client=self.mpt_client, registry=commerce)
3137

3238

33-
class CommerceMpt(MPTClient):
39+
class CommerceMpt(MPTClientBase):
3440
"""Commerce MPT API Client."""
3541

3642
@property

0 commit comments

Comments
 (0)