summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2018-07-16 13:34:18 +0200
committerMartin Trigaux <mat@odoo.com>2018-07-17 13:42:50 +0200
commitaf9d6b86a1eb8213f738c73fe80209b44f789510 (patch)
treec46166ea20a210c7df6586dcfe4916502011cad2
parent5a57c29ff2ac0c6b75aaba963b094809b8e60d44 (diff)
[ADD] tools: add new 3.7 opcodes
Python 3.7 introduced two new opcodes LOAD_METHOD and CALL_METHOD. https://docs.python.org/3/whatsnew/3.7.html#cpython-bytecode-changes https://bugs.python.org/issue26110 Basic QWeb rendering was failing on operations like request.csrf_token() ValueError: forbidden opcode(s) in 'request.csrf_token()': LOAD_METHOD, CALL_METHOD Closes #25783
-rw-r--r--odoo/tools/safe_eval.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/odoo/tools/safe_eval.py b/odoo/tools/safe_eval.py
index 7f5d6e35e71..7a5ec03707a 100644
--- a/odoo/tools/safe_eval.py
+++ b/odoo/tools/safe_eval.py
@@ -101,6 +101,8 @@ _SAFE_OPCODES = _EXPR_OPCODES.union(set(opmap[x] for x in [
'CALL_FUNCTION_EX',
# Already in P2 but apparently the first one is used more aggressively in P3
'CALL_FUNCTION_KW', 'CALL_FUNCTION_VAR', 'CALL_FUNCTION_VAR_KW',
+ # Added in P3.7 https://bugs.python.org/issue26110
+ 'CALL_METHOD', 'LOAD_METHOD',
'GET_ITER', 'FOR_ITER', 'YIELD_VALUE',
'JUMP_FORWARD', 'JUMP_IF_TRUE', 'JUMP_IF_FALSE', 'JUMP_ABSOLUTE',
# New in Python 2.7 - http://bugs.python.org/issue4715 :