from struct import unpack
from binascii import unhexlify
-from nominatim_core.errors import UsageError
+from .errors import UsageError
from .localization import Locales
# pylint: disable=no-member,too-many-boolean-expressions,too-many-instance-attributes
else field.default
if field.metadata and 'transform' in field.metadata:
return field.metadata['transform'](v)
- if not isinstance(v, field.type):
+ if not isinstance(v, field.type): # type: ignore[arg-type]
raise UsageError(f"Parameter '{field.name}' needs to be of {field.type!s}.")
return v