Skip to content

Commit ae8f477

Browse files
committed
Update optional MySQL code
1 parent a572324 commit ae8f477

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

seleniumbase/core/mysql.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class DatabaseManager:
77
def __init__(self, database_env="test", conf_creds=None):
88
"""Create a connection to the MySQL DB."""
99
import fasteners
10+
import sys
1011
import time
1112
from seleniumbase import config as sb_config
1213
from seleniumbase.config import settings
@@ -21,7 +22,10 @@ def __init__(self, database_env="test", conf_creds=None):
2122
try:
2223
import pymysql
2324
except Exception:
24-
shared_utils.pip_install("pymysql", version="1.0.2")
25+
if sys.version_info < (3, 7):
26+
shared_utils.pip_install("pymysql", version="1.0.2")
27+
else:
28+
shared_utils.pip_install("pymysql", version="1.1.0")
2529
import pymysql
2630
db_server = settings.DB_HOST
2731
db_port = settings.DB_PORT

0 commit comments

Comments
 (0)