Skip to content

Commit 5c96033

Browse files
authored
Merge pull request #38 from Som-Energia/FIX_support_py3_8
Support python version 3.10
2 parents a4c0046 + 9dcbfb8 commit 5c96033

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mongodb2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
##############################################################################
2222

2323
import tools
24-
from pymongo import MongoClient, MongoReplicaSetClient
24+
from pymongo import MongoClient
2525
from pymongo.errors import AutoReconnect
2626
from pymongo.read_preferences import ReadPreference
2727
import re
@@ -158,7 +158,6 @@ def mongo_connect(self):
158158
if tools.config['mongodb_replicaset']:
159159
kwargs.update({'replicaSet': tools.config['mongodb_replicaset'],
160160
'read_preference': ReadPreference.SECONDARY_PREFERRED})
161-
mongo_client = MongoReplicaSetClient
162161

163162
connection = mongo_client(self.uri, **kwargs)
164163
except Exception as e:
@@ -207,6 +206,7 @@ def get_db(self):
207206
try:
208207
db = self.connection[tools.config['mongodb_name']]
209208
except AutoReconnect:
209+
210210
max_tries = 5
211211
count = 0
212212
while count < max_tries:

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
pymongo==2.9
1+
pymongo==2.9;python_version<="2.7.18"
2+
pymongo>=3.12;python_version>"2.7.18"
23
six

0 commit comments

Comments
 (0)