Skip to content

Commit

Permalink
safe_eval: 3.11 compatibility
Browse files Browse the repository at this point in the history
Complement on 1e35315 (odoo#112450):
alongside the split between forwards and backwards jump we missed that
3.11 has a specialized version of each for the `is None` and `is not
None` cases. A use of that was added in standard in 16.5 (odoo#120446) but
more generally it makes sense that server actions would support
conditional tests against `None`, probably...
  • Loading branch information
xmo-odoo authored and sbidoul committed Jan 16, 2024
1 parent 5e6dd41 commit 0835045
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions odoo/tools/safe_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def to_opcodes(opnames, _opmap=opmap):
# replacement of POP_JUMP_IF_TRUE and POP_JUMP_IF_FALSE
'POP_JUMP_FORWARD_IF_FALSE', 'POP_JUMP_FORWARD_IF_TRUE',
'POP_JUMP_BACKWARD_IF_FALSE', 'POP_JUMP_BACKWARD_IF_TRUE',
# special case of the previous for IS NONE / IS NOT NONE
'POP_JUMP_FORWARD_IF_NONE', 'POP_JUMP_BACKWARD_IF_NONE',
'POP_JUMP_FORWARD_IF_NOT_NONE', 'POP_JUMP_BACKWARD_IF_NOT_NONE',
#replacement of JUMP_ABSOLUTE
'JUMP_BACKWARD',
#replacement of JUMP_IF_NOT_EXC_MATCH
Expand Down

0 comments on commit 0835045

Please sign in to comment.