Catching specific exceptions in Python Script?
Hi all I would like to be able to catch specific exceptions with Python Scripts: eg. try: ..... except Exception, e: ..... of try: .... except sql.error, e: .... This doesn't work as none of these exceptions are imported, also I cannot import them due to the import constraints of Python Scripts. Is there a workaround for this other than using external methods? Etienne
Etienne Labuschagne writes:
... In Python Script ... try: ..... except Exception, e: ..... This doesn't work as none of these exceptions are imported, also I cannot import them due to the import constraints of Python Scripts. Is there a workaround for this other than using external methods? There is a way to make modules/module names importable, though a bit tedious.
The mailing list archives are your friend. Search for "ModuleSecurityInfo". Alternatively: look at "AccessControl/SecurityInfo.py".
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> Bah! Someone who does not read instructions...
Dieter
participants (2)
-
Dieter Maurer -
Etienne Labuschagne