]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix Python deprecation warning in printers.py
authorJonathan Wakely <jwakely@redhat.com>
Wed, 16 Oct 2024 08:22:37 +0000 (09:22 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 16 Oct 2024 09:12:24 +0000 (10:12 +0100)
commit23480efbab9212adb3a0147a3e5dd93d53e1843b
treef447a91254028720a33189ed573edfb095166008
parentf1cee9d1a049a3bc7cae24245fcc3c415fd12764
libstdc++: Fix Python deprecation warning in printers.py

python/libstdcxx/v6/printers.py:1355: DeprecationWarning: 'count' is passed as positional argument

The Python docs say:

  Deprecated since version 3.13: Passing count and flags as positional
  arguments is deprecated. In future Python versions they will be
  keyword-only parameters.

Using a keyword argument for count only became possible with Python 3.1
so introduce a new function to do the substitution.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (strip_fundts_namespace): New.
(StdExpAnyPrinter, StdExpOptionalPrinter): Use it.

(cherry picked from commit b9e98bb9919fa9f07782f23f79b3d35abb9ff542)
libstdc++-v3/python/libstdcxx/v6/printers.py