aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-04-24 16:31:08 +0100
committerDavid Shah <dave@ds0.me>2020-04-24 16:31:08 +0100
commitfd099cef52a2ef7a83bc3f68d6e7ed736516978e (patch)
treebaca9dcc65b5bf10affb791094491ca20cc038c2 /common
parent5e40589114c1a61825d3772165f457895fc9acd0 (diff)
downloadnextpnr-fd099cef52a2ef7a83bc3f68d6e7ed736516978e.tar.gz
nextpnr-fd099cef52a2ef7a83bc3f68d6e7ed736516978e.tar.bz2
nextpnr-fd099cef52a2ef7a83bc3f68d6e7ed736516978e.zip
python: Wrap map IdString key when accessed by index
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r--common/pycontainers.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/pycontainers.h b/common/pycontainers.h
index 04c670cc..3584b45e 100644
--- a/common/pycontainers.h
+++ b/common/pycontainers.h
@@ -410,7 +410,8 @@ template <typename T1, typename T2> struct map_pair_wrapper_uptr
if ((i >= 2) || (i < 0))
KeyError();
return (i == 1) ? object(PythonConversion::ContextualWrapper<V &>(x.ctx, *x.base.second.get()))
- : object(x.base.first);
+ : object(PythonConversion::string_converter<decltype(x.base.first)>().to_str(x.ctx,
+ x.base.first));
}
static int len(wrapped_pair &x) { return 2; }