1010from __future__ import absolute_import
1111import _awscrt
1212from concurrent .futures import Future
13- from awscrt import NativeResource , isinstance_str
13+ from awscrt import NativeResource
1414import awscrt .exceptions
1515from awscrt .io import ClientBootstrap , EventLoopGroup , DefaultHostResolver , InputStream , TlsConnectionOptions , SocketOptions
1616from enum import IntEnum
@@ -30,7 +30,7 @@ class HttpConnectionBase(NativeResource):
3030 __slots__ = ('_shutdown_future' , '_version' )
3131
3232 def __init__ (self ):
33- super (HttpConnectionBase , self ).__init__ ()
33+ super ().__init__ ()
3434
3535 self ._shutdown_future = Future ()
3636
@@ -113,7 +113,7 @@ def new(cls,
113113 Otherwise, it will contain an exception.
114114 """
115115 assert isinstance (bootstrap , ClientBootstrap ) or bootstrap is None
116- assert isinstance_str (host_name )
116+ assert isinstance (host_name , str )
117117 assert isinstance (port , int )
118118 assert isinstance (tls_connection_options , TlsConnectionOptions ) or tls_connection_options is None
119119 assert isinstance (socket_options , SocketOptions ) or socket_options is None
@@ -226,7 +226,7 @@ class HttpStreamBase(NativeResource):
226226 __slots__ = ('_connection' , '_completion_future' , '_on_body_cb' )
227227
228228 def __init__ (self , connection , on_body = None ):
229- super (HttpStreamBase , self ).__init__ ()
229+ super ().__init__ ()
230230 self ._connection = connection
231231 self ._completion_future = Future ()
232232 self ._on_body_cb = on_body
@@ -268,7 +268,7 @@ def __init__(self, connection, request, on_response=None, on_body=None):
268268 assert callable (on_response ) or on_response is None
269269 assert callable (on_body ) or on_body is None
270270
271- super (HttpClientStream , self ).__init__ (connection , on_body )
271+ super ().__init__ (connection , on_body )
272272
273273 self ._on_response_cb = on_response
274274 self ._response_status_code = None
@@ -318,7 +318,7 @@ class HttpMessageBase(NativeResource):
318318 def __init__ (self , binding , headers , body_stream = None ):
319319 assert isinstance (headers , HttpHeaders )
320320
321- super (HttpMessageBase , self ).__init__ ()
321+ super ().__init__ ()
322322 self ._binding = binding
323323 self ._headers = headers
324324
@@ -364,7 +364,7 @@ def __init__(self, method='GET', path='/', headers=None, body_stream=None):
364364 headers = HttpHeaders ()
365365
366366 binding = _awscrt .http_message_new_request (headers )
367- super (HttpRequest , self ).__init__ (binding , headers , body_stream )
367+ super ().__init__ (binding , headers , body_stream )
368368 self .method = method
369369 self .path = path
370370
@@ -414,7 +414,7 @@ class HttpHeaders(NativeResource):
414414 __slots__ = ()
415415
416416 def __init__ (self , name_value_pairs = None ):
417- super (HttpHeaders , self ).__init__ ()
417+ super ().__init__ ()
418418 self ._binding = _awscrt .http_headers_new ()
419419 if name_value_pairs :
420420 self .add_pairs (name_value_pairs )
@@ -435,8 +435,8 @@ def add(self, name, value):
435435 name (str): Name.
436436 value (str): Value.
437437 """
438- assert isinstance_str (name )
439- assert isinstance_str (value )
438+ assert isinstance (name , str )
439+ assert isinstance (value , str )
440440 _awscrt .http_headers_add (self ._binding , name , value )
441441
442442 def add_pairs (self , name_value_pairs ):
@@ -456,8 +456,8 @@ def set(self, name, value):
456456 name (str): Name.
457457 value (str): Value.
458458 """
459- assert isinstance_str (name )
460- assert isinstance_str (value )
459+ assert isinstance (name , str )
460+ assert isinstance (value , str )
461461 _awscrt .http_headers_set (self ._binding , name , value )
462462
463463 def get_values (self , name ):
@@ -470,7 +470,7 @@ def get_values(self, name):
470470 Returns:
471471 Iterator[Tuple[str, str]]:
472472 """
473- assert isinstance_str (name )
473+ assert isinstance (name , str )
474474 name = name .lower ()
475475 for i in range (_awscrt .http_headers_count (self ._binding )):
476476 name_i , value_i = _awscrt .http_headers_get_index (self ._binding , i )
@@ -489,7 +489,7 @@ def get(self, name, default=None):
489489 Returns:
490490 str:
491491 """
492- assert isinstance_str (name )
492+ assert isinstance (name , str )
493493 return _awscrt .http_headers_get (self ._binding , name , default )
494494
495495 def remove (self , name ):
@@ -500,7 +500,7 @@ def remove(self, name):
500500 Args:
501501 name (str): Header name.
502502 """
503- assert isinstance_str (name )
503+ assert isinstance (name , str )
504504 _awscrt .http_headers_remove (self ._binding , name )
505505
506506 def remove_value (self , name , value ):
@@ -512,8 +512,8 @@ def remove_value(self, name, value):
512512 name (str): Name.
513513 value (str): Value.
514514 """
515- assert isinstance_str (name )
516- assert isinstance_str (value )
515+ assert isinstance (name , str )
516+ assert isinstance (value , str )
517517 _awscrt .http_headers_remove_value (self ._binding , name , value )
518518
519519 def clear (self ):
@@ -542,7 +542,7 @@ class HttpProxyAuthenticationType(IntEnum):
542542 """Username and password"""
543543
544544
545- class HttpProxyOptions ( object ) :
545+ class HttpProxyOptions :
546546 """
547547 Proxy options for HTTP clients.
548548
0 commit comments