diff --git a/dpath/segments.py b/dpath/segments.py index d87a7b2..b5edc4e 100644 --- a/dpath/segments.py +++ b/dpath/segments.py @@ -325,6 +325,8 @@ def set( # code agnostic to whether current is a list or a dict. # Unfortunately, for our use, 'x in thing' for lists checks # values, not keys whereas dicts check keys. + if isinstance(current, dict) and current.get(str(segment)): + segment = str(segment) current[segment] except (KeyError, IndexError): if creator is not None: diff --git a/dpath/version.py b/dpath/version.py index 127c148..66f584a 100644 --- a/dpath/version.py +++ b/dpath/version.py @@ -1 +1 @@ -VERSION = "2.1.0" +VERSION = "2.1.1" \ No newline at end of file