[1/2] libstdc++: Define _versioned_namespace in xmethods.py

Message ID 20231003171851.1161340-2-tromey@adacore.com
State Unresolved
Headers
Series A couple minor _versioned_namespace patches |

Checks

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

Commit Message

Tom Tromey Oct. 3, 2023, 5:18 p.m. UTC
  flake8 pointed out that is_specialization_of in xmethods.py looks at a
global that wasn't added to the file.  This patch correct the
oversight.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/xmethods.py (_versioned_namespace):
	Define.
---
 libstdc++-v3/python/libstdcxx/v6/xmethods.py | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Jonathan Wakely Oct. 3, 2023, 10:57 p.m. UTC | #1
On Tue, 3 Oct 2023, 18:19 Tom Tromey, <tromey@adacore.com> wrote:

> flake8 pointed out that is_specialization_of in xmethods.py looks at a
> global that wasn't added to the file.  This patch correct the
> oversight.
>

OK, thanks



>
> libstdc++-v3/ChangeLog:
>
>         * python/libstdcxx/v6/xmethods.py (_versioned_namespace):
>         Define.
> ---
>  libstdc++-v3/python/libstdcxx/v6/xmethods.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libstdc++-v3/python/libstdcxx/v6/xmethods.py
> b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
> index 844c8a2105a..8ccf57c4d6b 100644
> --- a/libstdc++-v3/python/libstdcxx/v6/xmethods.py
> +++ b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
> @@ -28,6 +28,8 @@ def get_bool_type():
>  def get_std_size_type():
>      return gdb.lookup_type('std::size_t')
>
> +_versioned_namespace = '__8::'
> +
>  def is_specialization_of(x, template_name):
>      """
>      Test whether a type is a specialization of the named class template.
> --
> 2.40.1
>
>
  

Patch

diff --git a/libstdc++-v3/python/libstdcxx/v6/xmethods.py b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
index 844c8a2105a..8ccf57c4d6b 100644
--- a/libstdc++-v3/python/libstdcxx/v6/xmethods.py
+++ b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
@@ -28,6 +28,8 @@  def get_bool_type():
 def get_std_size_type():
     return gdb.lookup_type('std::size_t')
 
+_versioned_namespace = '__8::'
+
 def is_specialization_of(x, template_name):
     """
     Test whether a type is a specialization of the named class template.