File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -252,13 +252,15 @@ def isp(self, ip_address: IPAddress) -> ISP:
252252 def _get (self , database_type : str , ip_address : IPAddress ) -> Any :
253253 if database_type not in self ._db_type :
254254 caller = inspect .stack ()[2 ][3 ]
255+ msg = f"The { caller } method cannot be used with the { self ._db_type } database"
255256 raise TypeError (
256- f"The { caller } method cannot be used with the { self . _db_type } database" ,
257+ msg ,
257258 )
258259 (record , prefix_len ) = self ._db_reader .get_with_prefix_len (ip_address )
259260 if record is None :
261+ msg = f"The address { ip_address } is not in the database."
260262 raise geoip2 .errors .AddressNotFoundError (
261- f"The address { ip_address } is not in the database." ,
263+ msg ,
262264 str (ip_address ),
263265 prefix_len ,
264266 )
Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ def test_city_full(self) -> None:
395395 r"^geoip2.models.City\(\[.*en.*\], .*geoname_id.*\)" ,
396396 )
397397
398- self .assertFalse (model == True , "__eq__ does not blow up on weird input" )
398+ self .assertFalse (model is True , "__eq__ does not blow up on weird input" )
399399
400400 def test_unknown_keys (self ) -> None :
401401 model = geoip2 .models .City (
You can’t perform that action at this time.
0 commit comments