diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2019-08-25 12:10:35 -0400 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2019-08-26 09:18:37 -0400 |
commit | d9c4ba536c522b8dc2194d4100270a159be7894a (patch) | |
tree | ca2766a9bdf6c16faab131365fd3fcf28a1099f8 /gdb/testsuite/ChangeLog | |
parent | 37606e67df760b14ecf8dd9cf870a2364541b0b6 (diff) | |
download | gdb-d9c4ba536c522b8dc2194d4100270a159be7894a.zip gdb-d9c4ba536c522b8dc2194d4100270a159be7894a.tar.gz gdb-d9c4ba536c522b8dc2194d4100270a159be7894a.tar.bz2 |
Use raw strings on gdb.python/py-xmethods.exp (and fix Python 3.8's "SyntaxWarning: invalid escape sequence")
The way unrecognized escape sequences are handled has changed in
Python 3.8: users now see a SyntaxWarning message, which will
eventually become a SyntaxError in future versions of Python:
(gdb) source /blabla/gdb.python/py-xmethods/py-xmethods.py
/blabla/gdb.python/py-xmethods/py-xmethods.py:204: SyntaxWarning: invalid escape seque
nce \+
'operator\+',
/blabla/gdb.python/py-xmethods/py-xmethods.py:211: SyntaxWarning: invalid escape seque
nce \+
'operator\+\+',
One of our testcases, gdb.python/py-xmethods.exp, contains strings in
the form of "operator\+". This is not recognized by Python, but is
still needed by the testsuite to work properly. The solution is
simple: we just have to make sure these strings are marked as
raw (i.e, r""). This is what this patch does. I took the opportunity
to also convert other strings to raw, which, in two cases, allowed the
removal of an extra backslash.
I tested this using Python 3.7 and Python 3.8, and everything works
fine.
I think I could push this as obvious, but decided to send it to
gdb-patches just in case.
gdb/testsuite/ChangeLog:
2019-08-26 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.python/py-xmethods.exp: Use raw strings when passing
arguments to SimpleXMethodMatcher.
Diffstat (limited to 'gdb/testsuite/ChangeLog')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 639bea2..e8445f8 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-08-26 Sergio Durigan Junior <sergiodj@redhat.com> + + * gdb.python/py-xmethods.exp: Use raw strings when passing + arguments to SimpleXMethodMatcher. + 2019-08-22 Tom de Vries <tdevries@suse.de> * gdb.multi/multi-term-settings.exp (coretest): Make gdb_test messages |