# HG changeset patch # User Franz Glasner # Date 1691021986 -7200 # Node ID a0b464f6ab1fce8697b61b6aa2280202cb96d004 # Parent e7f6fc454f84854327a6f0b67bc674884bc935f4 FIX: Allow only real _Schema instances as schemas in a Context diff -r e7f6fc454f84 -r a0b464f6ab1f data_schema/__init__.py --- a/data_schema/__init__.py Wed Aug 02 17:54:16 2023 +0200 +++ b/data_schema/__init__.py Thu Aug 03 02:19:46 2023 +0200 @@ -440,6 +440,9 @@ current_object=_SENTINEL, settings=_SENTINEL, key_index=_SENTINEL): + if root_schema is not _SENTINEL: + if not isinstance(root_schema, _Schema): + raise TypeError("schema must be a `_Schema' not a pure `dict'") if parent is None: if key is not _SENTINEL: raise TypeError("the root context may not have a key")