Skip to content

Commit d5ae0d6

Browse files
committed
Fixes
1 parent 108ba8e commit d5ae0d6

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

pymongo/asynchronous/collection.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,7 @@ def __init__(
231231
from pymongo.asynchronous.database import AsyncDatabase
232232

233233
if not isinstance(database, AsyncDatabase):
234-
raise TypeError(
235-
f"AsyncCollection requires an AsyncDatabase, {database} is an instance of {type(database)}"
236-
)
234+
raise TypeError(f"AsyncCollection requires an AsyncDatabase but {type(database)} given")
237235

238236
if not name or ".." in name:
239237
raise InvalidName("collection names cannot be empty")

pymongo/asynchronous/encryption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ async def create_encrypted_collection(
686686
"""
687687
if not isinstance(database, AsyncDatabase):
688688
raise TypeError(
689-
f"create_encrypted_collection() requires an AsyncDatabase, but {database} is an instance of {type(database)}"
689+
f"create_encrypted_collection() requires an AsyncDatabase but {type(database)} given"
690690
)
691691

692692
encrypted_fields = deepcopy(encrypted_fields)

pymongo/synchronous/collection.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ def __init__(
234234
from pymongo.synchronous.database import Database
235235

236236
if not isinstance(database, Database):
237-
raise TypeError(
238-
f"Collection requires a Database, {database} is an instance of {type(database)}"
239-
)
237+
raise TypeError(f"Collection requires a Database but {type(database)} given")
240238

241239
if not name or ".." in name:
242240
raise InvalidName("collection names cannot be empty")

pymongo/synchronous/encryption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def create_encrypted_collection(
684684
"""
685685
if not isinstance(database, Database):
686686
raise TypeError(
687-
f"create_encrypted_collection() requires a Database, but {database} is an instance of {type(database)}"
687+
f"create_encrypted_collection() requires a Database but {type(database)} given"
688688
)
689689

690690
encrypted_fields = deepcopy(encrypted_fields)

0 commit comments

Comments
 (0)