summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-04-16 07:59:32 -0700
committerGitHub <noreply@github.com>2022-04-16 07:59:32 -0700
commit84c279b514141f608cf480905c87d48998e296d1 (patch)
treec2c2ac2e6897ed5bacc7703ed73288f5d6d97f78 /Tools
parentgh-82849: revise intro to os.path.rst (GH-32232) (diff)
downloadcpython-84c279b514141f608cf480905c87d48998e296d1.tar.gz
cpython-84c279b514141f608cf480905c87d48998e296d1.tar.bz2
cpython-84c279b514141f608cf480905c87d48998e296d1.zip
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 9300b6d72948b94c0924a75ea14c6298156522d0) Co-authored-by: Yu Liu <yuki.liu@utexas.edu>
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 270aeb426eb..12b519330d8 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -1291,7 +1291,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])