@@ -114,11 +114,11 @@ def normalize_base_url(base_url: str) -> str:
114114 original_error = exc ,
115115 ) from exc
116116 if (
117- not isinstance (parsed_base_url_scheme , str )
118- or not isinstance (parsed_base_url_netloc , str )
119- or not isinstance (parsed_base_url_path , str )
120- or not isinstance (parsed_base_url_query , str )
121- or not isinstance (parsed_base_url_fragment , str )
117+ type (parsed_base_url_scheme ) is not str
118+ or type (parsed_base_url_netloc ) is not str
119+ or type (parsed_base_url_path ) is not str
120+ or type (parsed_base_url_query ) is not str
121+ or type (parsed_base_url_fragment ) is not str
122122 ):
123123 raise HyperbrowserError ("base_url parser returned invalid URL components" )
124124 try :
@@ -130,8 +130,9 @@ def normalize_base_url(base_url: str) -> str:
130130 "Failed to parse base_url host" ,
131131 original_error = exc ,
132132 ) from exc
133- if parsed_base_url_hostname is not None and not isinstance (
134- parsed_base_url_hostname , str
133+ if (
134+ parsed_base_url_hostname is not None
135+ and type (parsed_base_url_hostname ) is not str
135136 ):
136137 raise HyperbrowserError ("base_url parser returned invalid URL components" )
137138 if (
@@ -159,12 +160,14 @@ def normalize_base_url(base_url: str) -> str:
159160 "Failed to parse base_url credentials" ,
160161 original_error = exc ,
161162 ) from exc
162- if parsed_base_url_username is not None and not isinstance (
163- parsed_base_url_username , str
163+ if (
164+ parsed_base_url_username is not None
165+ and type (parsed_base_url_username ) is not str
164166 ):
165167 raise HyperbrowserError ("base_url parser returned invalid URL components" )
166- if parsed_base_url_password is not None and not isinstance (
167- parsed_base_url_password , str
168+ if (
169+ parsed_base_url_password is not None
170+ and type (parsed_base_url_password ) is not str
168171 ):
169172 raise HyperbrowserError ("base_url parser returned invalid URL components" )
170173 if parsed_base_url_username is not None or parsed_base_url_password is not None :
0 commit comments