@@ -111,26 +111,22 @@ def __init__(self, target, retry, timeout, metadata=None):
111
111
self ._timeout = timeout
112
112
self ._metadata = metadata
113
113
114
- def __call__ (self , * args , ** kwargs ):
114
+ def __call__ (self , * args , timeout = DEFAULT , retry = DEFAULT , ** kwargs ):
115
115
"""Invoke the low-level RPC with retry, timeout, and metadata."""
116
- # Note: Due to Python 2 lacking keyword-only arguments we use kwargs to
117
- # extract the retry and timeout params.
118
- timeout_ = _determine_timeout (
116
+ timeout = _determine_timeout (
119
117
self ._timeout ,
120
- kwargs . pop ( " timeout" , self . _timeout ) ,
118
+ timeout ,
121
119
# Use only the invocation-specified retry only for this, as we only
122
120
# want to adjust the timeout deadline if the *user* specified
123
121
# a different retry.
124
- kwargs . get ( " retry" , None ) ,
122
+ retry ,
125
123
)
126
124
127
- retry = kwargs .pop ("retry" , self ._retry )
128
-
129
125
if retry is DEFAULT :
130
126
retry = self ._retry
131
127
132
128
# Apply all applicable decorators.
133
- wrapped_func = _apply_decorators (self ._target , [retry , timeout_ ])
129
+ wrapped_func = _apply_decorators (self ._target , [retry , timeout ])
134
130
135
131
# Add the user agent metadata to the call.
136
132
if self ._metadata is not None :
0 commit comments