@@ -115,7 +115,7 @@ async def request(self, method: str, params: str = None) -> Dict[str, Any]:
115
115
return response
116
116
117
117
async def _call (
118
- self , method : str , params : Dict [str , Any ] = {} , start : int = 0
118
+ self , method : str , params : Dict [str , Any ] = None , start : int = 0
119
119
) -> Dict [str , Any ]:
120
120
"""Async call a REST method with specified parameters.
121
121
@@ -125,6 +125,8 @@ async def _call(
125
125
params (dict): Optional arguments which will be converted to a POST request string
126
126
start (int): Offset for pagination
127
127
"""
128
+ if params is None :
129
+ params = {}
128
130
params ["start" ] = start
129
131
130
132
payload = self ._prepare_params (params )
@@ -139,7 +141,7 @@ async def _call(
139
141
return res ["result" ] + result
140
142
return res ["result" ]
141
143
142
- def callMethod (self , method : str , params : Dict [str , Any ] = {} , ** kwargs ) -> Dict [str , Any ]:
144
+ def callMethod (self , method : str , params : Dict [str , Any ] = None , ** kwargs ) -> Dict [str , Any ]:
143
145
"""Call a REST method with specified parameters.
144
146
145
147
Parameters
@@ -151,6 +153,8 @@ def callMethod(self, method: str, params: Dict[str, Any] = {}, **kwargs) -> Dict
151
153
-------
152
154
Returning the REST method response as an array, an object or a scalar
153
155
"""
156
+ if params is None :
157
+ params = {}
154
158
if not method or len (method .split ("." )) < 2 :
155
159
raise BitrixError ("Wrong method name" , 400 )
156
160
0 commit comments