public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove more Python 2 code
@ 2022-04-04  9:40 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-04-04  9:40 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ea6303b4971b0959329a1ae01648b16a4f4ac154

commit ea6303b4971b0959329a1ae01648b16a4f4ac154
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Apr 1 14:29:35 2022 -0600

    Remove more Python 2 code
    
    I found another more place that still had a workaround for Python 2.
    This patch removes it.

Diff:
---
 gdb/python/lib/gdb/FrameDecorator.py | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/gdb/python/lib/gdb/FrameDecorator.py b/gdb/python/lib/gdb/FrameDecorator.py
index 46febcd5cf6..118673fc8b6 100644
--- a/gdb/python/lib/gdb/FrameDecorator.py
+++ b/gdb/python/lib/gdb/FrameDecorator.py
@@ -15,15 +15,6 @@
 
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-04  9:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04  9:40 [binutils-gdb] Remove more Python 2 code Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).