Is there anything wrong with replacing
if not isinstance(env, trac.env.Environment):
raise TypeError("Initializer must be called with " ...
with
env = env.parent or env
in ProductEnvironment constructor? The assertion is there to prevent
nesting of ProductEnvironments, but this is still achieved with the
bottom version. Extracting global env when product env is passed would
simplify a lot of places in code where a check is needed before
instantiating ProductEnvironment. It would also pass all the failing
wiki syntax tests.
Anze
|