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:
252
252
def _get (self , database_type : str , ip_address : IPAddress ) -> Any :
253
253
if database_type not in self ._db_type :
254
254
caller = inspect .stack ()[2 ][3 ]
255
+ msg = f"The { caller } method cannot be used with the { self ._db_type } database"
255
256
raise TypeError (
256
- f"The { caller } method cannot be used with the { self . _db_type } database" ,
257
+ msg ,
257
258
)
258
259
(record , prefix_len ) = self ._db_reader .get_with_prefix_len (ip_address )
259
260
if record is None :
261
+ msg = f"The address { ip_address } is not in the database."
260
262
raise geoip2 .errors .AddressNotFoundError (
261
- f"The address { ip_address } is not in the database." ,
263
+ msg ,
262
264
str (ip_address ),
263
265
prefix_len ,
264
266
)
Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ def test_city_full(self) -> None:
395
395
r"^geoip2.models.City\(\[.*en.*\], .*geoname_id.*\)" ,
396
396
)
397
397
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" )
399
399
400
400
def test_unknown_keys (self ) -> None :
401
401
model = geoip2 .models .City (
You can’t perform that action at this time.
0 commit comments