From 82af5e4a1920578fbd9dc36de8c1760311fb9837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20G=C3=A9rard?= Date: Tue, 18 Jun 2019 22:55:51 +0200 Subject: [PATCH] fix small finding from review on py2py3 compat --- mongoengine/base/document.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mongoengine/base/document.py b/mongoengine/base/document.py index 4948e672..4e4df92f 100644 --- a/mongoengine/base/document.py +++ b/mongoengine/base/document.py @@ -3,6 +3,7 @@ import numbers from functools import partial from bson import DBRef, ObjectId, SON, json_util +from future.utils import listitems import pymongo import six from six import iteritems @@ -670,7 +671,7 @@ class BaseDocument(object): del set_data["_id"] # Determine if any changed items were actually unset. - for path, value in list(set_data.items()): + for path, value in listitems(set_data): if value or isinstance( value, (numbers.Number, bool) ): # Account for 0 and True that are truthy