8000 Fix VERSION for dynamic version (#1098) · PyMySQL/PyMySQL@930b250 · GitHub
[go: up one dir, main page]

Skip to content

Commit 930b250

Browse files
authored
Fix VERSION for dynamic version (#1098)
1 parent 7b0e0ea commit 930b250

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pymysql/__init__.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
)
4848

4949

50-
VERSION = (1, 0, 3, None)
51-
if VERSION[3] is not None:
50+
VERSION = (1, 0, 3)
51+
if len(VERSION) > 3:
5252
VERSION_STRING = "%d.%d.%d_%s" % VERSION
5353
else:
54-
VERSION_STRING = "%d.%d.%d" % VERSION[:3]
54+
VERSION_STRING = "%d.%d.%d" % VERSION
5555
threadsafety = 1
5656
apilevel = "2.0"
5757
paramstyle = "pyformat"
@@ -113,10 +113,7 @@ def Binary(x):
113113

114114

115115
def get_client_info(): # for MySQLdb compatibility
116-
version = VERSION
117-
if VERSION[3] is None:
118-
version = VERSION[:3]
119-
return ".".join(map(str, version))
116+
return VERSION_STRING
120117

121118

122119
# we include a doctored version_info here for MySQLdb compatibility

0 commit comments

Comments
 (0)
0