0

What are differences in exception from the coding point of view in Odoo 11 as compared in Odoo 10? Can't find other differences except except Exception, e: to except Exception as e: My code shows error somehow from exception while converting a module from Odoo 10 to Odoo 11.

Jay
  • 41
  • 1
  • 10
  • The exception handling is related to the Python version you are using - Odoo 11 [supports Python 3 only](https://www.odoo.com/groups/community-59/community-32859400) and in Python 3 [only `except Exception as e:` is supported](https://www.python.org/dev/peps/pep-3110/). Could you post the code snippet/error you are getting for us to be able to help you better (https://stackoverflow.com/help/how-to-ask)? – Naglis Jan 02 '18 at 20:32

1 Answers1

0

In Python 2.5 and earlier versions, 'as' isn't supported, so you use except Exception, e:

In Python 2.6+ versions, both can be used.

But from Python 3.x, except Exception as e is required to assign an exception to a variable.

Sorginah
  • 112
  • 11