Skip to content

Commit b5b389d

Browse files
authored
adodbapi simplify onWindows checks (#2668)
1 parent dd2b536 commit b5b389d

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

adodbapi/test/adodbapitestconfig.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
"""
4343
)
4444
exit()
45-
try:
46-
onWindows = bool(sys.getwindowsversion()) # seems to work on all versions of Python
47-
except:
48-
onWindows = False
4945

5046
# create a random name for temporary table names
5147
_alphabet = (
@@ -89,7 +85,7 @@
8985
doSqlServerTest = "--mssql" in sys.argv or doAllTests
9086
doMySqlTest = "--mysql" in sys.argv or doAllTests
9187
doPostgresTest = "--pg" in sys.argv or doAllTests
92-
doTimeTest = ("--time" in sys.argv or doAllTests) and onWindows
88+
doTimeTest = ("--time" in sys.argv or doAllTests) and sys.platform == "win32"
9389

9490
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
9591
# # start your environment setup here v v v

adodbapi/test/test_adodbapi_dbapi20.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
print(adodbapi.version)
3030
print("Tested with dbapi20 %s" % dbapi20.__version__)
3131

32-
try:
33-
onWindows = bool(sys.getwindowsversion()) # seems to work on all versions of Python
34-
except:
35-
onWindows = False
36-
3732
node = platform.node()
3833

3934
conn_kws = {}
@@ -56,7 +51,7 @@
5651
)
5752
connStr = "%(provider)s; %(security)s; Initial Catalog=%(name)s;Data Source=%(host)s"
5853

59-
if onWindows and node != "z-PC":
54+
if sys.platform == "win32" and node != "z-PC":
6055
pass # default should make a local SQL Server connection
6156
elif node == "xxx": # try Postgres database
6257
_computername = "25.223.161.222"

0 commit comments

Comments
 (0)