Skip to content

Commit c171d75

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 <yuki.liu@utexas.edu>
1 parent 514162b commit c171d75

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

12871287
# Map non-printable US ASCII to '\xhh' */
1288-
elif ch < ' ' or ch == 0x7F:
1288+
elif ch < ' ' or ord(ch) == 0x7F:
12891289
out.write('\\x')
12901290
out.write(hexdigits[(ord(ch) >> 4) & 0x000F])
12911291
out.write(hexdigits[ord(ch) & 0x000F])

0 commit comments

Comments
 (0)