Author: chrisz
Date: Tue Dec 21 14:35:27 2010
New Revision: 7196
URL: http://trac.turbogears.org/changeset/7196
Log:
Small patch to make errorhandling more backward compatible with TG 1.0.
Modified:
branches/1.1/turbogears/errorhandling.py
branches/1.5/turbogears/errorhandling.py
Modified: branches/1.1/turbogears/errorhandling.py
==============================================================================
--- branches/1.1/turbogears/errorhandling.py Sun Dec 19 21:48:23 2010
(r7195)
+++ branches/1.1/turbogears/errorhandling.py Tue Dec 21 14:35:27 2010
(r7196)
@@ -20,6 +20,10 @@
"""
+# for easier usage and backward compatibility:
+dispatch_error.when = when.__get__(dispatch_error)
+dispatch_error.around = around.__get__(dispatch_error)
+
@when(dispatch_error, "tg_errors and has_arg(tg_source, 'tg_errors')")
def _register_implicit_errh(controller, tg_source,
tg_errors, tg_exceptions, *args, **kw):
Modified: branches/1.5/turbogears/errorhandling.py
==============================================================================
--- branches/1.5/turbogears/errorhandling.py Sun Dec 19 21:48:23 2010
(r7195)
+++ branches/1.5/turbogears/errorhandling.py Tue Dec 21 14:35:27 2010
(r7196)
@@ -20,6 +20,10 @@
"""
+# for easier usage and backward compatibility:
+dispatch_error.when = when.__get__(dispatch_error)
+dispatch_error.around = around.__get__(dispatch_error)
+
@when(dispatch_error, "tg_errors and has_arg(tg_source, 'tg_errors')")
def _register_implicit_errh(controller, tg_source,
tg_errors, tg_exceptions, *args, **kw):