summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorYu Liu <yuki.liu@utexas.edu>2022-04-16 14:34:48 (GMT)
committerGitHub <noreply@github.com>2022-04-16 14:34:48 (GMT)
commit9300b6d72948b94c0924a75ea14c6298156522d0 (patch)
treed8de4f11c8ff0a7a12993c300399cb5187229832 /Tools
parent95573ade42d1635dd9b69380117cbb47b6790772 (diff)
downloadcpython-9300b6d72948b94c0924a75ea14c6298156522d0.zip
cpython-9300b6d72948b94c0924a75ea14c6298156522d0.tar.gz
cpython-9300b6d72948b94c0924a75ea14c6298156522d0.tar.bz2
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>
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/gdb/libpython.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 4f7a8bc..610d130 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -1418,7 +1418,7 @@ class PyUnicodeObjectPtr(PyObjectPtr):
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])