Skip to content

Commit

Permalink
gh-91595: fix the comparison of character and integer by using ord() (#…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
sweetStreet and blurb-it[bot] committed Apr 16, 2022
1 parent 95573ad commit 9300b6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the comparison of character and integer inside :func:`Tools.gdb.libpython.write_repr`. Patch by Yu Liu.
2 changes: 1 addition & 1 deletion Tools/gdb/libpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ def write_repr(self, out, visited):
out.write('\\r')

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

0 comments on commit 9300b6d

Please sign in to comment.