diff --git a/share/roundup/templates/devel/extensions/timezone.py b/share/roundup/templates/devel/extensions/timezone.py --- a/share/roundup/templates/devel/extensions/timezone.py +++ b/share/roundup/templates/devel/extensions/timezone.py @@ -1,7 +1,10 @@ # Utility for replacing the simple input field for the timezone with # a select-field that lists the available values. -import cgi +try: + from html import escape +except ImportError: + from cgi import escape try: import pytz @@ -25,7 +28,7 @@ def tzfield(prop, name, default): s = ' ' if zone == value: s = 'selected=selected ' - z = cgi.escape(zone) + z = escape(zone) l.append('' % (s, z, z)) l.append('') return '\n'.join(l) diff --git a/share/roundup/templates/responsive/extensions/timezone.py b/share/roundup/templates/responsive/extensions/timezone.py --- a/share/roundup/templates/responsive/extensions/timezone.py +++ b/share/roundup/templates/responsive/extensions/timezone.py @@ -1,7 +1,10 @@ # Utility for replacing the simple input field for the timezone with # a select-field that lists the available values. -import cgi +try: + from html import escape +except ImportError: + from cgi import escape try: import pytz @@ -25,7 +28,7 @@ def tzfield(prop, name, default): s = ' ' if zone == value: s = 'selected=selected ' - z = cgi.escape(zone) + z = escape(zone) l.append('' % (s, z, z)) l.append('') return '\n'.join(l)