comparison data_schema/__init__.py @ 25:fd2a40c3d87b

Enhance exception message
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 08 Jul 2023 12:17:20 +0200
parents 413b344be2d1
children db3491e1b590
comparison
equal deleted inserted replaced
24:449f7c8ede19 25:fd2a40c3d87b
243 def __init__(self, parent, is_sub_root, *args, **kwds): 243 def __init__(self, parent, is_sub_root, *args, **kwds):
244 super().__init__(*args, **kwds) 244 super().__init__(*args, **kwds)
245 if parent is None or isinstance(parent, _Schema): 245 if parent is None or isinstance(parent, _Schema):
246 self.parent = parent 246 self.parent = parent
247 else: 247 else:
248 raise TypeError("`_Schema' or `None' expected") 248 raise TypeError(
249 "`_Schema' or `None' expected for `parent` argument")
249 if parent is None: 250 if parent is None:
250 self._schema_cache = {} 251 self._schema_cache = {}
251 if not is_sub_root: 252 if not is_sub_root:
252 raise ValueError( 253 raise ValueError(
253 "the root schmema must be a sub-root (aka `$self') also") 254 "the root schmema must be a sub-root (aka `$self') also")