Skip to content

Commit d689cc8

Browse files
authored
Merge pull request #775 from seleniumbase/update-the-mysql-connector
Update the Python MySQL connector
2 parents 4ca0bac + d66f40f commit d689cc8

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

examples/translations/pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Let console output be seen. Don't override the pytest plugin.
44
addopts = --capture=no --ignore conftest.py -p no:cacheprovider
55

6-
# Ignore warnings such as DeprecationWarning and pytest.PytestUnknownMarkWarning
6+
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =
88
ignore::pytest.PytestWarning
99
ignore:.*U.*mode is deprecated:DeprecationWarning

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Let console output be seen. Don't override the pytest plugin.
44
addopts = --capture=no --ignore conftest.py -p no:cacheprovider
55

6-
# Ignore warnings such as DeprecationWarning and pytest.PytestUnknownMarkWarning
6+
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =
88
ignore::pytest.PytestWarning
99
ignore:.*U.*mode is deprecated:DeprecationWarning

requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ soupsieve==1.9.6;python_version<"3.5"
4646
soupsieve==2.0.1;python_version>="3.5" and python_version<"3.6"
4747
soupsieve==2.1;python_version>="3.6"
4848
beautifulsoup4==4.9.3
49-
cryptography==3.0;python_version<"3.6"
49+
cryptography==2.9.2;python_version<"3.5"
50+
cryptography==3.0;python_version>="3.5" and python_version<"3.6"
5051
cryptography==3.3.1;python_version>="3.6"
5152
pyopenssl==19.1.0;python_version<"3.6"
5253
pyopenssl==20.0.1;python_version>="3.6"
@@ -64,7 +65,8 @@ colorama==0.4.4
6465
pathlib2==2.3.5;python_version<"3.5"
6566
importlib-metadata==2.0.0;python_version<"3.6"
6667
virtualenv>=20.2.2
67-
pymysql==0.10.1
68+
pymysql==0.10.1;python_version<"3.6"
69+
pymysql==1.0.0;python_version>="3.6"
6870
coverage==5.3.1
6971
brython==3.9.1
7072
pyotp==2.4.1

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "1.51.9"
2+
__version__ = "1.51.10"

seleniumbase/core/mysql.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Wrapper for MySQL DB functions to make life easier.
33
"""
44

5+
import sys
56
import time
67
from seleniumbase import config as sb_config
78
from seleniumbase.config import settings
@@ -40,11 +41,21 @@ def __init__(self, database_env='test', conf_creds=None):
4041
count = 0
4142
while count < retry_count:
4243
try:
43-
self.conn = pymysql.connect(host=db_server,
44-
port=db_port,
45-
user=db_user,
46-
passwd=db_pass,
47-
db=db_schema)
44+
if sys.version_info[0] == 3 and sys.version_info[1] >= 6 or (
45+
sys.version_info[0] > 3):
46+
# PyMySQL 1.0.0 or above renamed the variables.
47+
self.conn = pymysql.connect(host=db_server,
48+
port=db_port,
49+
user=db_user,
50+
password=db_pass,
51+
database=db_schema)
52+
else:
53+
# PyMySQL 0.10.1 for Python 2.7 and Python 3.5
54+
self.conn = pymysql.connect(host=db_server,
55+
port=db_port,
56+
user=db_user,
57+
passwd=db_pass,
58+
db=db_schema)
4859
self.conn.autocommit(True)
4960
self.cursor = self.conn.cursor()
5061
return

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@
150150
'soupsieve==2.0.1;python_version>="3.5" and python_version<"3.6"',
151151
'soupsieve==2.1;python_version>="3.6"',
152152
'beautifulsoup4==4.9.3',
153-
'cryptography==3.0;python_version<"3.6"',
153+
'cryptography==2.9.2;python_version<"3.5"',
154+
'cryptography==3.0;python_version>="3.5" and python_version<"3.6"',
154155
'cryptography==3.3.1;python_version>="3.6"',
155156
'pyopenssl==19.1.0;python_version<"3.6"',
156157
'pyopenssl==20.0.1;python_version>="3.6"',
@@ -168,7 +169,8 @@
168169
'pathlib2==2.3.5;python_version<"3.5"', # Sync with "virtualenv"
169170
'importlib-metadata==2.0.0;python_version<"3.6"', # Sync "virtualenv"
170171
'virtualenv>=20.2.2', # Sync with importlib-metadata and pathlib2
171-
'pymysql==0.10.1',
172+
'pymysql==0.10.1;python_version<"3.6"',
173+
'pymysql==1.0.0;python_version>="3.6"',
172174
'coverage==5.3.1',
173175
'brython==3.9.1',
174176
'pyotp==2.4.1',

0 commit comments

Comments
 (0)