Jay
Jay

Reputation: 41

Difference in Exception handling py code in Odoo 11

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.

Upvotes: 0

Views: 608

Answers (1)

Sorginah
Sorginah

Reputation: 122

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.

Upvotes: 0

Related Questions