diff options
author | David Shah <dave@ds0.me> | 2020-04-24 18:23:03 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-04-24 18:23:03 +0100 |
commit | 25938500d6d0fbcd6e14d7d5ff3e45275ead6bb7 (patch) | |
tree | 7fd3e809e960079aeacd66ae8a8fcfa37203e4c3 /common | |
parent | 8f1683246ed5493f131a530025d6c076142f6291 (diff) | |
download | nextpnr-25938500d6d0fbcd6e14d7d5ff3e45275ead6bb7.tar.gz nextpnr-25938500d6d0fbcd6e14d7d5ff3e45275ead6bb7.tar.bz2 nextpnr-25938500d6d0fbcd6e14d7d5ff3e45275ead6bb7.zip |
python: Also convert regular map keys to string
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r-- | common/pycontainers.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/pycontainers.h b/common/pycontainers.h index 3584b45e..2b9ee208 100644 --- a/common/pycontainers.h +++ b/common/pycontainers.h @@ -285,7 +285,9 @@ template <typename T1, typename T2, typename value_conv> struct map_pair_wrapper { if ((i >= 2) || (i < 0)) KeyError(); - return (i == 1) ? object(value_conv()(x.ctx, x.base.second)) : object(x.base.first); + return (i == 1) ? object(value_conv()(x.ctx, x.base.second)) + : object(PythonConversion::string_converter<decltype(x.base.first)>().to_str(x.ctx, + x.base.first)); } static int len(wrapped_pair &x) { return 2; } |