aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-11-16 10:53:34 +0000
committerAndrew Burgess <aburgess@redhat.com>2023-11-16 17:20:54 +0000
commit7db795bc67abfc8ea3a34057f434960ee0b3cf41 (patch)
treeeaab1fd57d96769ca4d0be10f73056e24f033ec1 /gdb/python
parent44167ca8da9aada2e574525e0548347f80442b09 (diff)
downloadfsf-binutils-gdb-7db795bc67abfc8ea3a34057f434960ee0b3cf41.zip
fsf-binutils-gdb-7db795bc67abfc8ea3a34057f434960ee0b3cf41.tar.gz
fsf-binutils-gdb-7db795bc67abfc8ea3a34057f434960ee0b3cf41.tar.bz2
gdb/python: remove use of str.isascii()
This commit: commit 8f6c452b5a4e50fbb55ff1d13328b392ad1fd416 Date: Sun Oct 15 22:48:42 2023 +0100 gdb: implement missing debug handler hook for Python introduced a use of str.isascii(), which was only added in Python 3.7. This commit switches to use curses.ascii.isascii(), as this was available in 3.6. The same is true for str.isalnum(), which is replaced with curses.ascii.isalnum(). There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/lib/gdb/missing_debug.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py
index 42d6985..bb233a6 100644
--- a/gdb/python/lib/gdb/missing_debug.py
+++ b/gdb/python/lib/gdb/missing_debug.py
@@ -18,6 +18,7 @@ MissingDebugHandler base class, and register_handler function.
"""
import gdb
+from curses.ascii import isascii, isalnum
def _validate_name(name):
@@ -38,7 +39,7 @@ def _validate_name(name):
name.
"""
for ch in name:
- if not ch.isascii() or not (ch.isalnum() or ch in "_-"):
+ if not isascii(ch) or not (isalnum(ch) or ch in "_-"):
raise ValueError("invalid character '%s' in handler name: %s" % (ch, name))