From: Marc Hartmayer Date: Tue, 24 Sep 2019 03:34:12 +0000 (+0200) Subject: closes bpo-16637: libpython: construct integer object directly from gdbvalue (GH... X-Git-Tag: v3.9.0a1~359 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f53d34fb0f944a8c0ee530334c353559ac40f72;p=thirdparty%2FPython%2Fcpython.git closes bpo-16637: libpython: construct integer object directly from gdbvalue (GH-15232) This fixes the exception '`ValueError: invalid literal for int() with base 10` if `str(gdbval)` returns a hexadecimal value (e.g. '0xa0'). This is the case if the output-radix is set to 16 in gdb. See https://sourceware.org/gdb/onlinedocs/gdb/Numbers.html for more information. --- diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index e28513db261b..2ab7d3b11cad 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -1392,7 +1392,7 @@ class wrapperobject(PyObjectPtr): def int_from_int(gdbval): - return int(str(gdbval)) + return int(gdbval) def stringify(val):