Message ID | 20180625210344.GA15790@redhat.com |
---|---|
State | New |
Headers | show |
Series | PR libstdc++/86112 fix printers for Python 2.6 | expand |
On 25/06/18 22:03 +0100, Jonathan Wakely wrote: >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. > >Tested x86_64-linux, committed to trunk. Oh, and gcc-8-branch.
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)