Skip to content
Snippets Groups Projects
Commit 57bcd7ca authored by Vincent Texier's avatar Vincent Texier
Browse files

[enh] #91 fix code to comply with mypy and pylint

Remove one pylint alert
parent d942d1a6
No related branches found
No related tags found
1 merge request!60Pylint
Pipeline #5665 passed
......@@ -17,4 +17,4 @@ mypy:
# check code errors
pylint:
pylint --disable=C,R0913,R0903,R0902,R0914,R0912,R0915 --enable=C0121,C0202,C0321 --jobs=0 duniterpy/
pylint --disable=C,R0913,R0903,R0902,R0914,R0912,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 duniterpy/
......@@ -236,12 +236,13 @@ class Client:
await parse_response(response, schema)
# return the chosen type
result = response # type: Any
if rtype == RESPONSE_TEXT:
response = await response.text()
result = await response.text()
elif rtype == RESPONSE_JSON:
response = await response.json()
result = await response.json()
return response
return result
async def post(self, url_path: str, params: dict = None, rtype: str = RESPONSE_JSON, schema: dict = None) -> Any:
"""
......@@ -267,12 +268,13 @@ class Client:
await parse_response(response, schema)
# return the chosen type
result = response # type: Any
if rtype == RESPONSE_TEXT:
response = await response.text()
result = await response.text()
elif rtype == RESPONSE_JSON:
response = await response.json()
result = await response.json()
return response
return result
def connect_ws(self, path: str) -> _WSRequestContextManager:
"""
......
......@@ -339,7 +339,7 @@ class UnlockParameter:
:param parameter: Parameter string
:return:
"""
result = None
result = None # type: Optional[Union[SIGParameter, XHXParameter]]
sig_param = SIGParameter.from_parameter(parameter)
if sig_param:
result = sig_param
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment