36
36
37
37
38
38
class _WrappedCall (aio .Call ):
39
-
40
39
def __init__ (self ):
41
40
self ._call = None
42
41
@@ -80,7 +79,6 @@ async def wait_for_connection(self):
80
79
81
80
82
81
class _WrappedUnaryResponseMixin (_WrappedCall ):
83
-
84
82
def __await__ (self ):
85
83
try :
86
84
response = yield from self ._call .__await__ ()
@@ -90,7 +88,6 @@ def __await__(self):
90
88
91
89
92
90
class _WrappedStreamResponseMixin (_WrappedCall ):
93
-
94
91
def __init__ (self ):
95
92
self ._wrapped_async_generator = None
96
93
@@ -117,7 +114,6 @@ def __aiter__(self):
117
114
118
115
119
116
class _WrappedStreamRequestMixin (_WrappedCall ):
120
-
121
117
async def write (self , request ):
122
118
try :
123
119
await self ._call .write (request )
@@ -142,11 +138,15 @@ class _WrappedUnaryStreamCall(_WrappedStreamResponseMixin, aio.UnaryStreamCall):
142
138
"""Wrapped UnaryStreamCall to map exceptions."""
143
139
144
140
145
- class _WrappedStreamUnaryCall (_WrappedUnaryResponseMixin , _WrappedStreamRequestMixin , aio .StreamUnaryCall ):
141
+ class _WrappedStreamUnaryCall (
142
+ _WrappedUnaryResponseMixin , _WrappedStreamRequestMixin , aio .StreamUnaryCall
143
+ ):
146
144
"""Wrapped StreamUnaryCall to map exceptions."""
147
145
148
146
149
- class _WrappedStreamStreamCall (_WrappedStreamRequestMixin , _WrappedStreamResponseMixin , aio .StreamStreamCall ):
147
+ class _WrappedStreamStreamCall (
148
+ _WrappedStreamRequestMixin , _WrappedStreamResponseMixin , aio .StreamStreamCall
149
+ ):
150
150
"""Wrapped StreamStreamCall to map exceptions."""
151
151
152
152
@@ -177,7 +177,7 @@ async def error_remapped_callable(*args, **kwargs):
177
177
elif isinstance (call , aio .StreamStreamCall ):
178
178
call = _WrappedStreamStreamCall ().with_call (call )
179
179
else :
180
- raise TypeError (' Unexpected type of call %s' % type (call ))
180
+ raise TypeError (" Unexpected type of call %s" % type (call ))
181
181
182
182
await call .wait_for_connection ()
183
183
return call
@@ -207,15 +207,16 @@ def wrap_errors(callable_):
207
207
208
208
209
209
def create_channel (
210
- target ,
211
- credentials = None ,
212
- scopes = None ,
213
- ssl_credentials = None ,
214
- credentials_file = None ,
215
- quota_project_id = None ,
216
- default_scopes = None ,
217
- default_host = None ,
218
- ** kwargs ):
210
+ target ,
211
+ credentials = None ,
212
+ scopes = None ,
213
+ ssl_credentials = None ,
214
+ credentials_file = None ,
215
+ quota_project_id = None ,
216
+ default_scopes = None ,
217
+ default_host = None ,
218
+ ** kwargs
219
+ ):
219
220
"""Create an AsyncIO secure channel with credentials.
220
221
221
222
Args:
@@ -251,7 +252,7 @@ def create_channel(
251
252
default_scopes = default_scopes ,
252
253
ssl_credentials = ssl_credentials ,
253
254
quota_project_id = quota_project_id ,
254
- default_host = default_host
255
+ default_host = default_host ,
255
256
)
256
257
257
258
return aio .secure_channel (target , composite_credentials , ** kwargs )
0 commit comments