@@ -299,7 +299,7 @@ def _build_ip_prefix_allocation_query(
299299 if prefix_length :
300300 input_data ["prefix_length" ] = prefix_length
301301 if member_type :
302- if member_type not in ( "prefix" , "address" ) :
302+ if member_type not in { "prefix" , "address" } :
303303 raise ValueError ("member_type possible values are 'prefix' or 'address'" )
304304 input_data ["member_type" ] = member_type
305305 if prefix_type :
@@ -956,7 +956,7 @@ async def execute_graphql(
956956 try :
957957 resp = await self ._post (url = url , payload = payload , headers = headers , timeout = timeout )
958958
959- if raise_for_error in ( None , True ) :
959+ if raise_for_error in { None , True } :
960960 resp .raise_for_status ()
961961
962962 retry = False
@@ -970,7 +970,7 @@ async def execute_graphql(
970970 self .log .error (f"Unable to connect to { self .address } .. " )
971971 raise
972972 except httpx .HTTPStatusError as exc :
973- if exc .response .status_code in [ 401 , 403 ] :
973+ if exc .response .status_code in { 401 , 403 } :
974974 response = decode_json (response = exc .response )
975975 errors = response .get ("errors" , [])
976976 messages = [error .get ("message" ) for error in errors ]
@@ -1208,7 +1208,7 @@ async def query_gql_query(
12081208 timeout = timeout or self .default_timeout ,
12091209 )
12101210
1211- if raise_for_error in ( None , True ) :
1211+ if raise_for_error in { None , True } :
12121212 resp .raise_for_status ()
12131213
12141214 return decode_json (response = resp )
@@ -1817,7 +1817,7 @@ def execute_graphql(
18171817 try :
18181818 resp = self ._post (url = url , payload = payload , headers = headers , timeout = timeout )
18191819
1820- if raise_for_error in ( None , True ) :
1820+ if raise_for_error in { None , True } :
18211821 resp .raise_for_status ()
18221822
18231823 retry = False
@@ -1831,7 +1831,7 @@ def execute_graphql(
18311831 self .log .error (f"Unable to connect to { self .address } .. " )
18321832 raise
18331833 except httpx .HTTPStatusError as exc :
1834- if exc .response .status_code in [ 401 , 403 ] :
1834+ if exc .response .status_code in { 401 , 403 } :
18351835 response = decode_json (response = exc .response )
18361836 errors = response .get ("errors" , [])
18371837 messages = [error .get ("message" ) for error in errors ]
@@ -2446,7 +2446,7 @@ def query_gql_query(
24462446 timeout = timeout or self .default_timeout ,
24472447 )
24482448
2449- if raise_for_error in ( None , True ) :
2449+ if raise_for_error in { None , True } :
24502450 resp .raise_for_status ()
24512451
24522452 return decode_json (response = resp )
0 commit comments