From ef63aeaf6984e5d8599bae6d7aa4e983a17ba609 Mon Sep 17 00:00:00 2001 From: Albert Sola Date: Thu, 21 Aug 2025 15:34:05 +0100 Subject: [PATCH] MPT-12874 Fix unplanned recursion on MPTClient with commerce --- mpt_api_client/mptclient.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mpt_api_client/mptclient.py b/mpt_api_client/mptclient.py index f54c7fd..45dcae5 100644 --- a/mpt_api_client/mptclient.py +++ b/mpt_api_client/mptclient.py @@ -3,8 +3,8 @@ from mpt_api_client.resources import OrderCollectionClient -class MPTClient: - """MPT API Client.""" +class MPTClientBase: + """MPT API Client Base.""" def __init__( self, @@ -19,6 +19,10 @@ def __init__( def __getattr__(self, name): # type: ignore[no-untyped-def] return self.registry.get(name)(client=self.mpt_client) + +class MPTClient(MPTClientBase): + """MPT API Client.""" + @property def commerce(self) -> "CommerceMpt": """Commerce MPT API Client. @@ -30,7 +34,7 @@ def commerce(self) -> "CommerceMpt": return CommerceMpt(mpt_client=self.mpt_client, registry=commerce) -class CommerceMpt(MPTClient): +class CommerceMpt(MPTClientBase): """Commerce MPT API Client.""" @property