fix flake8 findings

This commit is contained in:
Bastien Gérard 2020-01-05 22:50:19 +01:00
parent 60c42dddd5
commit 84f3dce492
2 changed files with 1 additions and 2 deletions

View File

@ -29,7 +29,7 @@ def count_documents(collection, filter, skip=None, limit=None, hint=None, collat
try:
return collection.count_documents(filter=filter, **kwargs)
except (AttributeError, OperationFailure) as ex:
except (AttributeError, OperationFailure):
# AttributeError - count_documents appeared in pymongo 3.7
# OperationFailure - accounts for some operators that used to work
# with .count but are no longer working with count_documents (i.e $geoNear, $near, and $nearSphere)

View File

@ -12,7 +12,6 @@ import pymongo.errors
from pymongo.collection import ReturnDocument
from pymongo.common import validate_read_preference
import six
from pymongo.errors import OperationFailure
from six import iteritems
from mongoengine import signals