Skip to content

Commit 73d38c8

Browse files
Navjot SinghNavjot Singh
authored andcommitted
fixed linting errors and added name in contributors
1 parent 65f9beb commit 73d38c8

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

bson/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ def _dict_to_bson(
10091009
try:
10101010
elements.append(_element_to_bson(key, value, check_keys, opts))
10111011
except InvalidDocument as err:
1012-
raise InvalidDocument("Invalid document {} | {}".format(doc,err)) from err
1012+
raise InvalidDocument(f"Invalid document {doc} | {err}") from err
10131013
except AttributeError:
10141014
raise TypeError(f"encoder expected a mapping type but got: {doc!r}") from None
10151015

doc/contributors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@ The following is a list of people who have contributed to
102102
- Ivan Lukyanchikov (ilukyanchikov)
103103
- Terry Patterson
104104
- Romain Morotti
105+
- Navjot Singh (navjots18)

test/test_bson.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,6 @@ def __repr__(self):
10011001
encode({"t": Wrapper(1)})
10021002

10031003
def test_doc_in_invalid_document_error_message(self):
1004-
10051004
class Wrapper:
10061005
def __init__(self, val):
10071006
self.val = val
@@ -1011,9 +1010,7 @@ def __repr__(self):
10111010

10121011
self.assertEqual("1", repr(Wrapper(1)))
10131012
doc = {"t": Wrapper(1)}
1014-
with self.assertRaisesRegex(
1015-
InvalidDocument, "Invalid document {}".format(doc)
1016-
):
1013+
with self.assertRaisesRegex(InvalidDocument, f"Invalid document {doc}"):
10171014
encode(doc)
10181015

10191016

0 commit comments

Comments
 (0)