diff --git a/adodbapi/test/adodbapitestconfig.py b/adodbapi/test/adodbapitestconfig.py index 0a2b871c7b..983480e4a4 100644 --- a/adodbapi/test/adodbapitestconfig.py +++ b/adodbapi/test/adodbapitestconfig.py @@ -42,10 +42,6 @@ """ ) exit() -try: - onWindows = bool(sys.getwindowsversion()) # seems to work on all versions of Python -except: - onWindows = False # create a random name for temporary table names _alphabet = ( @@ -89,7 +85,7 @@ doSqlServerTest = "--mssql" in sys.argv or doAllTests doMySqlTest = "--mysql" in sys.argv or doAllTests doPostgresTest = "--pg" in sys.argv or doAllTests -doTimeTest = ("--time" in sys.argv or doAllTests) and onWindows +doTimeTest = ("--time" in sys.argv or doAllTests) and sys.platform == "win32" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # start your environment setup here v v v diff --git a/adodbapi/test/test_adodbapi_dbapi20.py b/adodbapi/test/test_adodbapi_dbapi20.py index 6218b7997e..50f4c0f03a 100644 --- a/adodbapi/test/test_adodbapi_dbapi20.py +++ b/adodbapi/test/test_adodbapi_dbapi20.py @@ -29,11 +29,6 @@ print(adodbapi.version) print("Tested with dbapi20 %s" % dbapi20.__version__) -try: - onWindows = bool(sys.getwindowsversion()) # seems to work on all versions of Python -except: - onWindows = False - node = platform.node() conn_kws = {} @@ -56,7 +51,7 @@ ) connStr = "%(provider)s; %(security)s; Initial Catalog=%(name)s;Data Source=%(host)s" -if onWindows and node != "z-PC": +if sys.platform == "win32" and node != "z-PC": pass # default should make a local SQL Server connection elif node == "xxx": # try Postgres database _computername = "25.223.161.222"