Skip to content

Commit

Permalink
Guard sys.modules against import time side effects using ``ProxyF…
Browse files Browse the repository at this point in the history
…actory``.
  • Loading branch information
malthe committed Aug 10, 2011
1 parent e3eb6db commit fff85e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

In next release ...

- Guard ``sys.modules`` (mapped to the builtin variable "modules")
against import-time side effects using ``ProxyFactory``.

2.1 (2011-07-28)
~~~~~~~~~~~~~~~~

Expand Down
3 changes: 2 additions & 1 deletion src/z3c/pt/pagetemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys

from zope import i18n
from zope.security.proxy import ProxyFactory

from chameleon.i18n import fast_translate
from chameleon.zpt import template
Expand Down Expand Up @@ -37,7 +38,7 @@ def __len__(self):
def __repr__(self):
return "{...} (%d entries)" % len(self)

sys_modules = OpaqueDict(sys.modules)
sys_modules = ProxyFactory(OpaqueDict(sys.modules))


class DummyRegistry(object):
Expand Down

0 comments on commit fff85e8

Please sign in to comment.