Commit 26ca780e authored by Tres Seaver's avatar Tres Seaver

Clean up after ourselves.

parent 5963e711
...@@ -395,10 +395,13 @@ class TestActualPython(GuardTestCase): ...@@ -395,10 +395,13 @@ class TestActualPython(GuardTestCase):
_old_mgr = _old_policy = _marker = [] _old_mgr = _old_policy = _marker = []
def setUp(self): def setUp(self):
pass self._wrapped_dicts = []
def tearDown( self ): def tearDown( self ):
self._restorePolicyAndManager() self._restorePolicyAndManager()
for munged, orig in self._wrapped_dicts:
munged.update(orig)
del self._wrapped_dicts
def _initPolicyAndManager(self, manager=None): def _initPolicyAndManager(self, manager=None):
from AccessControl.SecurityManagement import get_ident from AccessControl.SecurityManagement import get_ident
...@@ -644,6 +647,8 @@ print foo(**kw) ...@@ -644,6 +647,8 @@ print foo(**kw)
# tell whether they're executed. # tell whether they're executed.
def _wrap_replaced_dict_callables(self, d): def _wrap_replaced_dict_callables(self, d):
import __builtin__ import __builtin__
orig = d.copy()
self._wrapped_dicts.append((d, orig))
for k, v in d.items(): for k, v in d.items():
if callable(v) and v is not getattr(__builtin__, k, None): if callable(v) and v is not getattr(__builtin__, k, None):
d[k] = FuncWrapper(k, v) d[k] = FuncWrapper(k, v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment