|
Than Ngo |
6f6455 |
commit 6383a72200df27b0515b6e3d09bfad8934eb5c76
|
|
Than Ngo |
6f6455 |
Author: albert-github <albert.tests@gmail.com>
|
|
Than Ngo |
6f6455 |
Date: Tue Sep 8 13:31:15 2020 +0200
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
Make testsqlite3.py python script running with python 3
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
The testsqlite3.py didn't run under python 3 (found by means of pylint).
|
|
Than Ngo |
6f6455 |
Making it runnable under python 2 and python 3.
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
diff --git a/testing/testsqlite3.py b/testing/testsqlite3.py
|
|
Than Ngo |
6f6455 |
index b4227b44..1d94f701 100755
|
|
Than Ngo |
6f6455 |
--- a/testing/testsqlite3.py
|
|
Than Ngo |
6f6455 |
+++ b/testing/testsqlite3.py
|
|
Than Ngo |
6f6455 |
@@ -13,7 +13,7 @@ g_conn=None
|
|
Than Ngo |
6f6455 |
val=[]
|
|
Than Ngo |
6f6455 |
def print_unprocessed_attributes(node):
|
|
Than Ngo |
6f6455 |
for key in node.attrib:
|
|
Than Ngo |
6f6455 |
- print "WARNING: '%s' has unprocessed attr '%s'" % (node.tag,key)
|
|
Than Ngo |
6f6455 |
+ print("WARNING: '%s' has unprocessed attr '%s'" % (node.tag,key))
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
def extract_attribute(node,attribute,pnl):
|
|
Than Ngo |
6f6455 |
if not attribute in node.attrib:
|
|
Than Ngo |
6f6455 |
@@ -69,7 +69,7 @@ def process_memberdef(node):
|
|
Than Ngo |
6f6455 |
extract_element(node,chld,q)
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
for chld in node.getchildren():
|
|
Than Ngo |
6f6455 |
- print "WARNING: '%s' has unprocessed child elem '%s'" % (node.tag,chld.tag)
|
|
Than Ngo |
6f6455 |
+ print("WARNING: '%s' has unprocessed child elem '%s'" % (node.tag,chld.tag))
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
extract_attribute(node,"kind",q)
|
|
Than Ngo |
6f6455 |
extract_attribute(node,"prot",q)
|
|
Than Ngo |
6f6455 |
@@ -90,12 +90,12 @@ def process_memberdef(node):
|
|
Than Ngo |
6f6455 |
r=[]
|
|
Than Ngo |
6f6455 |
try:
|
|
Than Ngo |
6f6455 |
r = g_conn.execute(query,val).fetchall()
|
|
Than Ngo |
6f6455 |
- except sqlite3.OperationalError,e:
|
|
Than Ngo |
6f6455 |
- print "SQL_ERROR:%s"%e
|
|
Than Ngo |
6f6455 |
+ except(sqlite3.OperationalError,e):
|
|
Than Ngo |
6f6455 |
+ print("SQL_ERROR:%s"%e)
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
del val[:]
|
|
Than Ngo |
6f6455 |
if not len(r) > 0:
|
|
Than Ngo |
6f6455 |
- print "TEST_ERROR: Member not found in SQL DB"
|
|
Than Ngo |
6f6455 |
+ print("TEST_ERROR: Member not found in SQL DB")
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
def load_xml(name):
|
|
Than Ngo |
6f6455 |
@@ -104,7 +104,7 @@ def load_xml(name):
|
|
Than Ngo |
6f6455 |
for event, elem in context:
|
|
Than Ngo |
6f6455 |
if event == "end" and elem.tag == "memberdef":
|
|
Than Ngo |
6f6455 |
process_memberdef(elem)
|
|
Than Ngo |
6f6455 |
- print "\n== Unprocessed XML =="
|
|
Than Ngo |
6f6455 |
+ print("\n== Unprocessed XML ==")
|
|
Than Ngo |
6f6455 |
# ET.dump(root)
|
|
Than Ngo |
6f6455 |
|
|
Than Ngo |
6f6455 |
|