From e22005fb27f66b916d4d5ff67c218bd6a7d20ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Tue, 23 Sep 2008 14:28:08 +0000 Subject: [PATCH] Change the way to test if the style is dynamic in something better. The current way was hiding AttributeError that may be raised while rendering this style. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23764 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5OOo/OOoTemplate.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/product/ERP5OOo/OOoTemplate.py b/product/ERP5OOo/OOoTemplate.py index 7db21ffc4b..d5724cf58b 100644 --- a/product/ERP5OOo/OOoTemplate.py +++ b/product/ERP5OOo/OOoTemplate.py @@ -456,11 +456,9 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0"> format = request.get('format') try: # If style is dynamic, call it - try: + if getattr(aq_base(ooo_document), '__call__', None) is not None: request.set('format', None) ooo_document = ooo_document() - except AttributeError: - pass finally: request.set('format', format) # Create a new builder instance -- 2.30.9