From: Alexander Alekhin Date: Tue, 1 Jun 2021 19:19:05 +0000 (+0000) Subject: ts: migrate from cgi.escape to html.escape in .py file X-Git-Tag: accepted/tizen/unified/20220125.121719~1^2~1^2~30^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59b4baee0c5fc0eff02bcfe14f398ba6e5d9e2fb;p=platform%2Fupstream%2Fopencv.git ts: migrate from cgi.escape to html.escape in .py file --- diff --git a/modules/ts/misc/table_formatter.py b/modules/ts/misc/table_formatter.py index 4129369..96bafab 100755 --- a/modules/ts/misc/table_formatter.py +++ b/modules/ts/misc/table_formatter.py @@ -1,7 +1,11 @@ #!/usr/bin/env python from __future__ import print_function -import sys, re, os.path, cgi, stat, math +import sys, re, os.path, stat, math +try: + from html import escape +except ImportError: + from cgi import escape # Python 2.7 from optparse import OptionParser from color import getColorizer, dummyColorizer @@ -23,7 +27,7 @@ class tblRow(object): self.props = props def htmlEncode(str): - return '
'.join([cgi.escape(s) for s in str]) + return '
'.join([escape(s) for s in str]) class table(object): def_align = "left"