Skip to content

Commit

Permalink
python: Also convert regular map keys to string
Browse files Browse the repository at this point in the history
Signed-off-by: David Shah <[email protected]>
  • Loading branch information
gatecat committed Apr 24, 2020
1 parent 8f16832 commit 2593850
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/pycontainers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit 2593850

Please sign in to comment.