fix parse errors with methodless stubs by adding a "pass" statement

This commit is contained in:
xloem 2023-06-21 22:24:39 -04:00 committed by Volodymyr Magamedov
parent f9f575a3dc
commit 519d4c66a8
1 changed files with 2 additions and 0 deletions

View File

@ -129,6 +129,8 @@ def render(
buf.add('def __init__(self, channel: {}.{}) -> None:'
.format(client.__name__, client.Channel.__name__))
with buf.indent():
if len(service.methods) == 0:
buf.add('pass')
for method in service.methods:
name, cardinality, request_type, reply_type = method
full_name = '/{}/{}'.format(service_name, name)