Skip to content

Commit

Permalink
Merge branch '2.13' into str-format-213
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Feb 1, 2017
2 parents 122ff6a + 512dfac commit b705f0d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/AccessControl/SimpleObjectPolicies.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ def override_containers(type_, assertions):
"""Temporarily override the container assertions."""
orig_container = Containers(type_, _marker)
ContainerAssertions[type_] = assertions
yield
if orig_container is _marker:
del ContainerAssertions[type_]
else:
ContainerAssertions[type_] = orig_container
try:
yield
finally:
if orig_container is _marker:
del ContainerAssertions[type_]
else:
ContainerAssertions[type_] = orig_container

0 comments on commit b705f0d

Please sign in to comment.