# HG changeset patch # User Sylvain Thénault # Date 1248771881 -7200 # Node ID 40e41eb34a7da5f4c7004649b215b9f2e6245967 # Parent 19eaaf9aebf2a6f392171801c4908e25fe2c0710 we've to call cleanup_sys_modules manually for proper schema modules cleanup diff -r 19eaaf9aebf2 -r 40e41eb34a7d schema.py --- a/schema.py Mon Jul 27 18:43:47 2009 +0200 +++ b/schema.py Tue Jul 28 11:04:41 2009 +0200 @@ -21,7 +21,7 @@ from yams.schema import Schema, ERSchema, EntitySchema, RelationSchema from yams.constraints import BaseConstraint, StaticVocabularyConstraint from yams.reader import CONSTRAINTS, PyFileReader, SchemaLoader, \ - obsolete as yobsolete + obsolete as yobsolete, cleanup_sys_modules from rql import parse, nodes, RQLSyntaxError, TypeResolverException @@ -868,7 +868,11 @@ path = reversed([config.apphome] + config.cubes_path()) else: path = reversed(config.cubes_path()) - return super(CubicWebSchemaLoader, self).load(config, path=path, **kwargs) + try: + return super(CubicWebSchemaLoader, self).load(config, path=path, **kwargs) + finally: + # we've to cleanup modules imported from cubicweb.schemas as well + cleanup_sys_modules([self.lib_directory]) def _load_definition_files(self, cubes): for filepath in (join(self.lib_directory, 'bootstrap.py'),