From 63d7b06412bf447e37890e66009365c3660a8da1 Mon Sep 17 00:00:00 2001 From: redi Date: Mon, 25 Jun 2018 21:03:49 +0000 Subject: [PATCH] PR libstdc++/86112 fix printers for Python 2.6 Dict comprehensions are only supported since Python 2.7, so use an alternative syntax that is backwards compatible. PR libstdc++/86112 * python/libstdcxx/v6/printers.py (add_one_template_type_printer): Replace dict comprehension. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262115 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/python/libstdcxx/v6/printers.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 288a929c8d2..eb79e8172b9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2018-06-25 Jonathan Wakely + PR libstdc++/86112 + * python/libstdcxx/v6/printers.py (add_one_template_type_printer): + Replace dict comprehension. + PR libstdc++/81092 * config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update. diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 45aaa1211ec..34d8b4e6606 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -1438,7 +1438,8 @@ def add_one_template_type_printer(obj, name, defargs): if _versioned_namespace: # Add second type printer for same type in versioned namespace: ns = 'std::' + _versioned_namespace - defargs = { n: d.replace('std::', ns) for n,d in defargs.items() } + # PR 86112 Cannot use dict comprehension here: + defargs = dict((n, d.replace('std::', ns)) for (n,d) in defargs.items()) printer = TemplateTypePrinter(ns+name, defargs) gdb.types.register_type_printer(obj, printer) -- 2.11.4.GIT