On Mon, 13 Nov 2023 at 14:41, Romain GEISSLER <romain.geiss...@amadeus.com> wrote: > > > Le 28 sept. 2023 à 22:21, Jonathan Wakely <jwakely redhat ! com> a écrit : > > > > Tested x86_64-linux (GDB 13.2, Python 3.11). Pushed to trunk. > > > > -- >8 -- > > > > Some of these changes were suggested by autopep8's --aggressive > > option, others are for readability. > > > > Break long lines by splitting strings across multiple lines, or > > introducing local variables to hold results. > > > > Use raw strings for regular expressions, so that backslashes don't need > > to be escaped. > > Hi Jonathan, > > FYI, it seems that with python 3.12, the bits "Use raw strings for regular > expressions" > seems to fix the following new Python warnings: > > /opt/1A/toolchain/x86_64-v23.0.19/lib/../share/gcc-13.2.1/python/libstdcxx/v6/printers.py:1273: > SyntaxWarning: invalid escape sequence '\d' > self.typename = re.sub('^std::experimental::fundamentals_v\d::', > 'std::experimental::', self.typename, 1) > /opt/1A/toolchain/x86_64-v23.0.19/lib/../share/gcc-13.2.1/python/libstdcxx/v6/printers.py:1302: > SyntaxWarning: invalid escape sequence '\w' > x = re.sub("std::string(?!\w)", s, m.group(1)) > … (snapped, there are a bit more than that in total). > > How ok would it be to backport to the branches still maintained the "raw > string" fix, > in order to avoid deprecation warnings as soon as people use gdb with python > >= 3.12 ?
Yes, I'll do that backport (and most of the other Python improvements too, at least for gcc-13). Thanks for raising it.