Remove all uses of assignment expressions.

This is needed to port to Python 3.7 because
Raspbian 10 doesn't have Python 3.8.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
This commit is contained in:
Oleg Girko
2020-08-18 03:44:06 +03:00
parent 5307765399
commit 2dbf11428f
9 changed files with 30 additions and 18 deletions

View File

@@ -77,8 +77,8 @@ def get_exposed_http(obj: object) -> List[HttpExposed]:
auth_required=getattr(handler, _HTTP_AUTH_REQUIRED),
handler=handler,
)
for name in dir(obj)
if inspect.ismethod(handler := getattr(obj, name)) and getattr(handler, _HTTP_EXPOSED, False)
for handler in [getattr(obj, name) for name in dir(obj)]
if inspect.ismethod(handler) and getattr(handler, _HTTP_EXPOSED, False)
]
@@ -107,8 +107,8 @@ def get_exposed_ws(obj: object) -> List[WsExposed]:
event_type=getattr(handler, _WS_EVENT_TYPE),
handler=handler,
)
for name in dir(obj)
if inspect.ismethod(handler := getattr(obj, name)) and getattr(handler, _WS_EXPOSED, False)
for handler in [getattr(obj, name) for name in dir(obj)]
if inspect.ismethod(handler) and getattr(handler, _WS_EXPOSED, False)
]