Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pymongo/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ def _create_or_update_user(

opts["roles"] = [self._default_role(read_only)]

elif read_only:
if read_only:
warnings.warn("The read_only option is deprecated in MongoDB "
">= 2.6, use 'roles' instead", DeprecationWarning)

Expand Down
2 changes: 1 addition & 1 deletion pymongo/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ def is_retrying():
# not support sessions raise the last error.
raise last_error
retryable = False
if is_retrying():
if session and is_retrying():
# Reset the transaction id and retry the operation.
session._retry_transaction_id()
return func(session, sock_info, retryable)
Expand Down
2 changes: 1 addition & 1 deletion test/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def test_explain_with_read_concern(self):
self.assertTrue(coll.find().explain())
started = listener.results['started']
self.assertEqual(len(started), 1)
self.assertNotIn("readConern", started[0].command)
self.assertNotIn("readConcern", started[0].command)

def test_hint(self):
db = self.db
Expand Down
2 changes: 1 addition & 1 deletion test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def read_from_which_host(
if isinstance(tag_sets, dict):
tag_sets = [tag_sets]
if tag_sets:
tags = tag_sets or pref.tag_sets
tags = list(set(tag_sets + pref.tag_sets))
pref = pref.__class__(tags)

db.read_preference = pref
Expand Down