@@ -117,18 +117,18 @@ def done_callback(self, cache_call):
117117 """
118118exception = cache_call .exception ()
119119if exception :
120- for future in self .futures :
120+ for future in self .futures :# type: ignore[attr-defined]
121121future .set_exception (exception )
122122
123123else :
124- for future in self .futures :
124+ for future in self .futures :# type: ignore[attr-defined]
125125future .set_result (None )
126126
127127def make_call (self ):
128128"""Make the actual call to the global cache. To be overridden."""
129129raise NotImplementedError
130130
131- def future_info (self , key ):
131+ def future_info (self , key , value = None ):
132132"""Generate info string for Future. To be overridden."""
133133raise NotImplementedError
134134
@@ -279,7 +279,7 @@ def make_call(self):
279279"""Call :method:`GlobalCache.get`."""
280280return _global_cache ().get (self .keys )
281281
282- def future_info (self , key ):
282+ def future_info (self , key , value = None ):
283283"""Generate info string for Future."""
284284return "GlobalCache.get({})" .format (key )
285285
@@ -373,7 +373,7 @@ def make_call(self):
373373"""Call :method:`GlobalCache.set`."""
374374return _global_cache ().set (self .todo , expires = self .expires )
375375
376- def future_info (self , key , value ):
376+ def future_info (self , key , value = None ):
377377"""Generate info string for Future."""
378378return "GlobalCache.set({}, {})" .format (key , value )
379379
@@ -436,7 +436,7 @@ def make_call(self):
436436"""Call :method:`GlobalCache.set`."""
437437return _global_cache ().set_if_not_exists (self .todo , expires = self .expires )
438438
439- def future_info (self , key , value ):
439+ def future_info (self , key , value = None ):
440440"""Generate info string for Future."""
441441return "GlobalCache.set_if_not_exists({}, {})" .format (key , value )
442442
@@ -482,7 +482,7 @@ def make_call(self):
482482"""Call :method:`GlobalCache.delete`."""
483483return _global_cache ().delete (self .keys )
484484
485- def future_info (self , key ):
485+ def future_info (self , key , value = None ):
486486"""Generate info string for Future."""
487487return "GlobalCache.delete({})" .format (key )
488488
@@ -513,7 +513,7 @@ def make_call(self):
513513"""Call :method:`GlobalCache.watch`."""
514514return _global_cache ().watch (self .todo )
515515
516- def future_info (self , key , value ):
516+ def future_info (self , key , value = None ):
517517"""Generate info string for Future."""
518518return "GlobalCache.watch({}, {})" .format (key , value )
519519
@@ -543,7 +543,7 @@ def make_call(self):
543543"""Call :method:`GlobalCache.unwatch`."""
544544return _global_cache ().unwatch (self .keys )
545545
546- def future_info (self , key ):
546+ def future_info (self , key , value = None ):
547547"""Generate info string for Future."""
548548return "GlobalCache.unwatch({})" .format (key )
549549
@@ -580,7 +580,7 @@ def make_call(self):
580580"""Call :method:`GlobalCache.compare_and_swap`."""
581581return _global_cache ().compare_and_swap (self .todo , expires = self .expires )
582582
583- def future_info (self , key , value ):
583+ def future_info (self , key , value = None ):
584584"""Generate info string for Future."""
585585return "GlobalCache.compare_and_swap({}, {})" .format (key , value )
586586
@@ -627,8 +627,7 @@ def global_lock_for_write(key):
627627 tasklets.Future: Eventual result will be a lock value to be used later with
628628 :func:`global_unlock`.
629629 """
630- lock = "." + str (uuid .uuid4 ())
631- lock = lock .encode ("ascii" )
630+ lock = ("." + str (uuid .uuid4 ())).encode ("ascii" )
632631utils .logging_debug (log , "lock for write: {}" , lock )
633632
634633def new_value (old_value ):
0 commit comments