@@ -1106,7 +1106,7 @@ def __init__(self):
1106
1106
self ._state = collections .defaultdict (list ) # type: FnApiRunner.StateServicer.StateType
1107
1107
self ._checkpoint = None # type: Optional[FnApiRunner.StateServicer.StateType]
1108
1108
self ._use_continuation_tokens = False
1109
- self ._continuations = {} # type: Dict[str , Tuple[bytes, ...]]
1109
+ self ._continuations = {} # type: Dict[bytes , Tuple[bytes, ...]]
1110
1110
1111
1111
def checkpoint (self ):
1112
1112
# type: () -> None
@@ -1145,17 +1145,17 @@ def get_raw(self,
1145
1145
if self ._use_continuation_tokens :
1146
1146
# The token is "nonce:index".
1147
1147
if not continuation_token :
1148
- token_base = 'token_%x' % len (self ._continuations )
1148
+ token_base = b 'token_%x' % len (self ._continuations )
1149
1149
self ._continuations [token_base ] = tuple (full_state )
1150
- return b'' , '%s:0' % token_base
1150
+ return b'' , b '%s:0' % token_base
1151
1151
else :
1152
- token_base , index = continuation_token .split (':' )
1152
+ token_base , index = continuation_token .split (b ':' )
1153
1153
ix = int (index )
1154
1154
full_state_cont = self ._continuations [token_base ]
1155
1155
if ix == len (full_state_cont ):
1156
1156
return b'' , None
1157
1157
else :
1158
- return full_state_cont [ix ], '%s:%d' % (token_base , ix + 1 )
1158
+ return full_state_cont [ix ], b '%s:%d' % (token_base , ix + 1 )
1159
1159
else :
1160
1160
assert not continuation_token
1161
1161
return b'' .join (full_state ), None
0 commit comments