From ba3fcb08eafd389bdbf0ab9c59577a25c8d8126d Mon Sep 17 00:00:00 2001 From: efkin Date: Mon, 13 Mar 2017 20:20:19 +0100 Subject: [test] Prepare tests for python3 compatibility --- testing/tests/sqlcipher/test_backend.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'testing/tests/sqlcipher') diff --git a/testing/tests/sqlcipher/test_backend.py b/testing/tests/sqlcipher/test_backend.py index caacba0d..643fa041 100644 --- a/testing/tests/sqlcipher/test_backend.py +++ b/testing/tests/sqlcipher/test_backend.py @@ -21,8 +21,11 @@ import os import pytest import time import threading - -from pysqlcipher import dbapi2 +import sys +if sys.version_info[0] < 3: + from pysqlcipher import dbapi2 +else: + from pysqlcipher3 import dbapi2 from testscenarios import TestWithScenarios # l2db stuff. @@ -148,7 +151,7 @@ class TestSQLCipherDatabase(tests.TestCase): def run(self): try: db2 = SQLCipherDatabaseTesting(dbname, 2) - except Exception, e: + except Exception as e: SecondTry.outcome2.append(e) else: SecondTry.outcome2.append(db2) -- cgit v1.2.3