Skip to content

Commit c1019cf

Browse files
committed
[FIX] base: traceback decoration cleanup
When 3.11 added PEP 657 fine-grained error locations, squiggles were already possible[^1] but apparently we missed that in the cleanup regex because those didn't show up in the messages we cared about. With Python 3.13's improvements (sic...)[^2] this is not the case anymore, and the tracebacks from testing the test suite do get a bunch of squiggles which we need to learn to clean. [^1]: https://docs.python.org/3/whatsnew/3.11.html#whatsnew311-pep657 [^2]: https://docs.python.org/3/whatsnew/3.13.html#improved-error-messages Part-of: #220858 Related: odoo/enterprise#91149 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
1 parent 5880b2f commit c1019cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

odoo/addons/base/tests/test_test_suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _clean_message(self, message):
134134
message = re.sub(r'line \d+', 'line $line', message)
135135
message = re.sub(r'py:\d+', 'py:$line', message)
136136
message = re.sub(r'decorator-gen-\d+', 'decorator-gen-xxx', message)
137-
message = re.sub(r'^\s*\^+\s*\n', '', message, flags=re.MULTILINE)
137+
message = re.sub(r'^\s*~*\^+~*\s*\n', '', message, flags=re.MULTILINE)
138138
message = message.replace(f'"{root_path}', '"/root_path/odoo')
139139
message = message.replace(f'"{python_path}', '"/usr/lib/python')
140140
message = message.replace('\\', '/')

0 commit comments

Comments
 (0)