Skip to content

Commit 9300b6d

Browse files
gh-91595: fix the comparison of character and integer by using ord() (#91596)
* fix the comparison of character and integer by using ord() * 📜🤖 Added by blurb_it. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent 95573ad commit 9300b6d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the comparison of character and integer inside :func:`Tools.gdb.libpython.write_repr`. Patch by Yu Liu.

Tools/gdb/libpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ def write_repr(self, out, visited):
14181418
out.write('\\r')
14191419

14201420
# Map non-printable US ASCII to '\xhh' */
1421-
elif ch < ' ' or ch == 0x7F:
1421+
elif ch < ' ' or ord(ch) == 0x7F:
14221422
out.write('\\x')
14231423
out.write(hexdigits[(ord(ch) >> 4) & 0x000F])
14241424
out.write(hexdigits[ord(ch) & 0x000F])

0 commit comments

Comments
 (0)