libstdc++: Fix <chrono> printers for Python 2 [PR108212]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 5 Jan 2023 13:41:21 +0000 (13:41 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 5 Jan 2023 16:28:43 +0000 (16:28 +0000)
commit80ff207da6d8784e227eb93f75c4ac5a300c8420
tree0a2d84f5cd59d5a961bdaddd824d9b02a5aefa2a
parente2eab3c4edb6aa9a93f982c4554cd756000934ca
libstdc++: Fix <chrono> printers for Python 2 [PR108212]

The datetime.timezone.utc singleton doesn't exist in Python 2, but we
can create it ourselves by deriving from datetime.tzinfo.

libstdc++-v3/ChangeLog:

PR libstdc++/108212
* python/libstdcxx/v6/printers.py (_utc_timezone): New global
variable.
(StdChronoTimePointPrinter::to_string): Use it.
libstdc++-v3/python/libstdcxx/v6/printers.py