Skip to content

Commit 5b7b711

Browse files
committed
Always pass expected_inquires dict
This saves some code.
1 parent 6ccced8 commit 5b7b711

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

splitgpg2/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ async def connect_agent(self) -> None:
476476
self.notify('connected')
477477

478478
# wait for agent hello
479-
await self.handle_agent_response()
479+
await self.handle_agent_response({})
480480

481481
def close(self, reason: str, log_level: int = logging.ERROR) -> None:
482482
self.log.log(log_level, '%s; Closing!', reason)
@@ -1043,8 +1043,7 @@ def agent_write(self, data: bytes) -> None:
10431043
writer.write(data)
10441044

10451045
async def handle_agent_response(self,
1046-
expected_inquires: Optional[Dict[bytes, 'ArgCallback']] = None) \
1047-
-> bool:
1046+
expected_inquires: Dict[bytes, 'ArgCallback']) -> bool:
10481047
""" Receive and handle one agent response. Return whether there are
10491048
more expected """
10501049
assert self.agent_reader is not None
@@ -1055,8 +1054,6 @@ async def handle_agent_response(self,
10551054
while await self.agent_reader.read(1024):
10561055
pass
10571056
return False
1058-
expected_inquires = (expected_inquires if expected_inquires is not None
1059-
else {})
10601057
# We generally consider the agent as trusted. But since the client can
10611058
# determine part of the response we handle this here as untrusted.
10621059
untrusted_line = await self.agent_reader.readline()

0 commit comments

Comments
 (0)