wizards/source/access2base/access2base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 49dfec0a061ca4595a3c5122e92e6a5524cb768b Author: Jean-Pierre Ledure <j...@ledure.be> AuthorDate: Fri Apr 22 16:28:12 2022 +0200 Commit: Jean-Pierre Ledure <j...@ledure.be> CommitDate: Fri Apr 22 18:18:46 2022 +0200 Access2Base - (access2base.py) Don't use bare except: statement The exception hierarchy described on page https://docs.python.org/3.5/library/exceptions.html#exception-hierarchy indicates that the default exception in bare except: statements is BaseException. This induces that the SystemExit, KeyboardInterrupt and GeneratorExit are also handled by the user script. This is a not recommended practice. Better is to use the explicit Exception built-in exception except Exception: Bug reported by Paul M on Telegram Change-Id: Ie1ae1f732ebc60a881e7d40ba8141aa704e9cd5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133328 Tested-by: Jean-Pierre Ledure <j...@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <j...@ledure.be> diff --git a/wizards/source/access2base/access2base.py b/wizards/source/access2base/access2base.py index 00b9c894488d..ce88057247e1 100644 --- a/wizards/source/access2base/access2base.py +++ b/wizards/source/access2base/access2base.py @@ -43,7 +43,7 @@ from platform import system as _opsys import datetime, os, sys, traceback _LIBRARY = '' # Should be 'Access2Base' or 'Access2BaseDev' -_VERSION = '7.1' # Actual version number +_VERSION = '7.4' # Actual version number _WRAPPERMODULE = 'Python' # Module name in the Access2Base library containing Python interfaces # CallByName types @@ -608,7 +608,7 @@ class _A2B(object, metaclass = _Singleton): Script = cls.xScript(script, module) try: Returned = Script.invoke((args), (), ())[0] - except: + except Exception: raise TypeError("Access2Base error: method '" + script + "' in Basic module '" + module + "' call error. Check its arguments.") else: if Returned == None: @@ -643,7 +643,7 @@ class _A2B(object, metaclass = _Singleton): args = (action,) + (basic,) + (script,) + args try: Returned = Script.invoke((args), (), ()) - except: + except Exception: raise TypeError("Access2Base error: method '" + script + "' call error. Check its arguments.") if isinstance(Returned[0], tuple):