Skip to content

Commit 7a97c87

Browse files
committed
Python Glacier2/session typing fixes
1 parent b1dd095 commit 7a97c87

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/Glacier2/session/server/poke_session/manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ def __init__(self, adapter: Ice.ObjectAdapter):
2929

3030
@override
3131
def create(
32-
self, userId: str, sessionControl: Glacier2.SessionControlPrx | None, current: Ice.Current
32+
self, userId: str, control: Glacier2.SessionControlPrx | None, current: Ice.Current
3333
) -> Glacier2.SessionPrx:
34-
# sessionControl is not None because we configured Glacier2.Server.Endpoints in the Glacier2 router
34+
# control is not None because we configured Glacier2.Server.Endpoints in the Glacier2 router
3535
# configuration file.
36-
assert sessionControl is not None
36+
assert control is not None
3737

3838
# Create a new session servant and add it to the adapter with a UUID identity. The name component of the
3939
# identity is the session token.
40-
proxy = self._sessionAdapter.addWithUUID(DefaultPokeSession(self._sessionAdapter, sessionControl, self))
40+
proxy = self._sessionAdapter.addWithUUID(DefaultPokeSession(self._sessionAdapter, control, self))
4141

4242
sessionToken = proxy.ice_getIdentity().name
4343
self._tokenToUserId[sessionToken] = userId

python/Glacier2/session/server/poke_session/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ def __init__(
3636
self._userIdResolver = userIdResolver
3737

3838
@override
39-
def getPokeBox(self, current: Ice.Current) -> CatchThemAll.PokeBoxPrx | None:
39+
def getPokeBox(self, current: Ice.Current) -> CatchThemAll.PokeBoxPrx:
4040
# The session token is the name component of the session identity; we use it for the identity of the PokeBox
4141
# object as well.
4242
proxy = self._adapter.createProxy(Ice.Identity(name=current.id.name, category="PokeBox"))
4343
return CatchThemAll.PokeBoxPrx.uncheckedCast(proxy)
4444

4545
@override
46-
async def destroy(self, current: Ice.Current) -> Awaitable[None]:
46+
async def destroy(self, current: Ice.Current) -> None:
4747
print(f"Destroying session #{current.id.name}")
4848

4949
# Remove the token from the user ID resolver, since the token is no longer valid.

0 commit comments

Comments
 (0)