]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove more Python 2 code
authorTom Tromey <tom@tromey.com>
Fri, 1 Apr 2022 20:29:35 +0000 (14:29 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 4 Apr 2022 09:40:22 +0000 (03:40 -0600)
I found another more place that still had a workaround for Python 2.
This patch removes it.

gdb/python/lib/gdb/FrameDecorator.py

index 46febcd5cf6a6ff382f807ba13433544ea69b0d1..118673fc8b6c6e063dbc307e3a5b78203afb0201 100644 (file)
 
 import gdb
 
-# This small code snippet deals with problem of strings in Python 2.x
-# and Python 3.x.  Python 2.x has str and unicode classes which are
-# sub-classes of basestring.  In Python 3.x all strings are encoded
-# and basestring has been removed.
-try:
-    basestring
-except NameError:
-    basestring = str
-
 
 class FrameDecorator(object):
     """Basic implementation of a Frame Decorator"""
@@ -252,7 +243,7 @@ class FrameVars(object):
         # SYM may be a string instead of a symbol in the case of
         # synthetic local arguments or locals.  If that is the case,
         # always fetch.
-        if isinstance(sym, basestring):
+        if isinstance(sym, str):
             return True
 
         sym_type = sym.addr_class