Skip to content

Commit 8e794bc

Browse files
committed
PYTHON-807 Avoid DeprecationWarning in GridIn.close().
1 parent 753356a commit 8e794bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gridfs/grid_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def __flush(self):
256256
# connection, can succeed out-of-order due to the writebackListener.
257257
# We mustn't call "filemd5" until all inserts are complete, which
258258
# we ensure by calling getLastError (and ignoring the result).
259-
db.error()
259+
db.command('getlasterror', read_preference=ReadPreference.PRIMARY)
260260

261261
md5 = db.command(
262262
"filemd5", self._id, root=self._coll.name,

0 commit comments

Comments
 (0)