diff options
| author | Xavier Morel <xmo@odoo.com> | 2017-05-17 13:56:46 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2017-08-19 02:34:22 +0200 |
| commit | 4d6d5c8290ec9640ad91e70b3b6836f7232fbb4d (patch) | |
| tree | 6f5ee645bd7d660e192aa48b15fac2141495698d /doc/_extensions | |
| parent | 25df2352f51e8622c1d709695b4784379747653d (diff) | |
[FIX] P3: stupid use of hasattr
In Python 2, hasattr swallows *any* exception raised during the
access. In Python 3, it only swallows AttributeError.
Accessing an attribute on an unbound threadlocal proxy raises
RuntimeError, while running test_ir_http_mimetype ``request`` is
unbound, in Python 2 ``hasattr`` would return ``False`` on an unbound
threadlocal, in Python 3 it lets ``RuntimeError`` pass through blowing
up the test.
Fix this by just checking if the threadlocal is bound by using it as a
boolean…
Diffstat (limited to 'doc/_extensions')
0 files changed, 0 insertions, 0 deletions
