Skip to content

Commit 049daf9

Browse files
authored
PYTHON-2935 Fix test_encryption.TestClientSimple.test_use_after_close (#751)
1 parent dd9206a commit 049daf9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pymongo/topology.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,8 @@ def _ensure_opened(self):
556556
Hold the lock when calling this.
557557
"""
558558
if self._closed:
559-
raise InvalidOperation("Once a MongoClient is closed, "
560-
"all operations will fail. Please create "
561-
"a new client object if you wish to "
562-
"reconnect.")
559+
raise InvalidOperation("Cannot use MongoClient after close")
560+
563561
if not self._opened:
564562
self._opened = True
565563
self._update_servers()

0 commit comments

Comments
 (0)