From 1bcd675ead609b8b423d227b9266df752f3c409a Mon Sep 17 00:00:00 2001 From: Matthieu Rigal Date: Mon, 15 Jun 2015 13:44:11 +0200 Subject: [PATCH] Python 3 fix, uses floor division --- mongoengine/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoengine/document.py b/mongoengine/document.py index dee6cc10..429f6065 100644 --- a/mongoengine/document.py +++ b/mongoengine/document.py @@ -182,7 +182,7 @@ class Document(BaseDocument): max_documents = cls._meta.get('max_documents') # Round up to next 256 bytes as MongoDB would do it to avoid exception if max_size % 256: - max_size = (max_size / 256 + 1) * 256 + max_size = (max_size // 256 + 1) * 256 if collection_name in db.collection_names(): cls._collection = db[collection_name]