]> 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, 11 Jun 2025 11:26:27 +0000 (12:26 +0100)
commit4205c99e4fc9454b05ebd50e89553a287a8c094b
treed99b9cfe20fc9634133ad537fc103e4ada323509
parentd14d9793bfb795193b3ed972c4930d75cf8a026b
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