Skip to content

Commit 84c279b

Browse files
gh-91595: fix the comparison of character and integer by using ord() (GH-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> (cherry picked from commit 9300b6d) Co-authored-by: Yu Liu <[email protected]>
1 parent f5542ec commit 84c279b

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
@@ -1291,7 +1291,7 @@ def write_repr(self, out, visited):
12911291
out.write('\\r')
12921292

12931293
# Map non-printable US ASCII to '\xhh' */
1294-
elif ch < ' ' or ch == 0x7F:
1294+
elif ch < ' ' or ord(ch) == 0x7F:
12951295
out.write('\\x')
12961296
out.write(hexdigits[(ord(ch) >> 4) & 0x000F])
12971297
out.write(hexdigits[ord(ch) & 0x000F])

0 commit comments

Comments
 (0)