1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

python: better Python 3 support

This commit is contained in:
Alexander Alekhin
2018-05-11 13:29:28 +03:00
parent df02fe0615
commit 78f205ffa5
7 changed files with 30 additions and 17 deletions
+2
View File
@@ -206,6 +206,8 @@ class table(object):
cell.width = len(max(cell.text, key = lambda line: len(line)))
def reformatTextValue(self, value):
if sys.version_info > (3,): # PY3 fix
unicode = str
if isinstance(value, str):
vstr = value
elif isinstance(value, unicode):
+4
View File
@@ -7,6 +7,10 @@ import os.path
import sys
from xml.dom.minidom import parse
if sys.version_info > (3,):
long = int
def cmp(a, b): return (a>b)-(a<b)
class TestInfo(object):
def __init__(self, xmlnode):