diff --git a/gridfs/grid_file.py b/gridfs/grid_file.py index 463213825..2185b3213 100644 --- a/gridfs/grid_file.py +++ b/gridfs/grid_file.py @@ -297,7 +297,7 @@ class GridIn(object): raise ValueError("cannot write to a closed file") # With w=0, 'filemd5' might run before the final chunks are written. - if 0 == self._coll.database.connection.write_concern.get('w'): + if not self._coll.acknowledged: raise InvalidOperation('Cannot write file to GridFS with w=0') try: