libstdc++: Correctly call _string_types function

Message ID 20231004151005.1676194-1-tromey@adacore.com
State Unresolved
Headers
Series libstdc++: Correctly call _string_types function |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Tom Tromey Oct. 4, 2023, 3:10 p.m. UTC
  flake8 points out that the new call to _string_types from
StdExpAnyPrinter.__init__ is not correct -- it needs to be qualified.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py
	(StdExpAnyPrinter.__init__): Qualify call to
	_string_types.
---
 libstdc++-v3/python/libstdcxx/v6/printers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jonathan Wakely Oct. 4, 2023, 3:11 p.m. UTC | #1
On Wed, 4 Oct 2023 at 16:10, Tom Tromey <tromey@adacore.com> wrote:
>
> flake8 points out that the new call to _string_types from
> StdExpAnyPrinter.__init__ is not correct -- it needs to be qualified.

OK, thanks.


>
> libstdc++-v3/ChangeLog:
>
>         * python/libstdcxx/v6/printers.py
>         (StdExpAnyPrinter.__init__): Qualify call to
>         _string_types.
> ---
>  libstdc++-v3/python/libstdcxx/v6/printers.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
> index 23efbd171ec..9a51f26d8e0 100644
> --- a/libstdc++-v3/python/libstdcxx/v6/printers.py
> +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
> @@ -1386,7 +1386,7 @@ class StdExpAnyPrinter(SingleObjContainerPrinter):
>              # FIXME need to expand 'std::string' so that gdb.lookup_type works
>              if 'std::string' in mgrname:
>                  mgrtypes = []
> -                for s in _string_types():
> +                for s in StdExpAnyPrinter._string_types():
>                      try:
>                          x = re.sub(r"std::string(?!\w)", s, m.group(1))
>                          # The following lookup might raise gdb.error if the
> --
> 2.40.1
>
  

Patch

diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 23efbd171ec..9a51f26d8e0 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1386,7 +1386,7 @@  class StdExpAnyPrinter(SingleObjContainerPrinter):
             # FIXME need to expand 'std::string' so that gdb.lookup_type works
             if 'std::string' in mgrname:
                 mgrtypes = []
-                for s in _string_types():
+                for s in StdExpAnyPrinter._string_types():
                     try:
                         x = re.sub(r"std::string(?!\w)", s, m.group(1))
                         # The following lookup might raise gdb.error if the