mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 10:31:54 +08:00
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:
@@ -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)
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user