Skip to content

Commit 991ab61

Browse files
committed
Resolved issue cannot import name IS_PYMONGO_3
1 parent b1174b7 commit 991ab61

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

flask_mongoengine/connection.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import atexit, os.path, time, mongoengine, sys
2-
import shutil, subprocess, tempfile
2+
import shutil, subprocess, tempfile, pymongo
33
from flask import current_app
44
from pymongo import MongoClient, ReadPreference, errors, uri_parser
5-
from mongoengine.python_support import IS_PYMONGO_3
65
from subprocess import Popen, PIPE
76
from pymongo.errors import InvalidURI
87
from mongoengine import connection
@@ -14,6 +13,10 @@
1413
)
1514

1615
DEFAULT_CONNECTION_NAME = 'default-mongodb-connection'
16+
if pymongo.version_tuple[0] < 3:
17+
IS_PYMONGO_3 = False
18+
else:
19+
IS_PYMONGO_3 = True
1720

1821
_connection_settings = {}
1922
_connections = {}

0 commit comments

Comments
 (0)