Commit 14322ab6 authored by Julien Muchembled's avatar Julien Muchembled

Drop Transaction extension & allow use of transaction.doom from Restricted Python

parent 6f99d9d1
import transaction
def abort_transaction():
# FIXME: aborting a transaction means it could be commited later on. The
# transaction should be doom()ed instead, but transaction.doom() is not
# available on Zope 2.8. We should provide our own doom() implementation
# which raises an exception on pre-commit-hook, which does exist
# in Zope 2.8
transaction.abort()
...@@ -228,3 +228,5 @@ def guarded_import(mname, globals=None, locals=None, fromlist=None, ...@@ -228,3 +228,5 @@ def guarded_import(mname, globals=None, locals=None, fromlist=None,
fromlist = ['__name__'] fromlist = ['__name__']
return orig_guarded_import(mname, globals, locals, fromlist, level) return orig_guarded_import(mname, globals, locals, fromlist, level)
safe_builtins['__import__'] = guarded_import safe_builtins['__import__'] = guarded_import
ModuleSecurityInfo('transaction').declarePublic('doom')
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