Skip to content

Commit 6f53d34

Browse files
marc1006benjaminp
authored andcommitted
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.
1 parent 4346bad commit 6f53d34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tools/gdb/libpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ def write_repr(self, out, visited):
13921392

13931393

13941394
def int_from_int(gdbval):
1395-
return int(str(gdbval))
1395+
return int(gdbval)
13961396

13971397

13981398
def stringify(val):

0 commit comments

Comments
 (0)