From 3efebca2ae2493ee8ba864258c6aa024ea2b9c82 Mon Sep 17 00:00:00 2001 From: Mo'men Basel Date: Mon, 26 Sep 2022 03:30:01 +0200 Subject: [PATCH] 2to3 handler.py making it compatible with python3: -cgi.escape() has been removed in python 3.8. use html.escape() instead. - The urlparse module is renamed to urllib.parse in Python 3. --- handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handler.py b/handler.py index dbc2d26..26aba8f 100644 --- a/handler.py +++ b/handler.py @@ -2,13 +2,14 @@ import tornado.ioloop, tornado.web, tornado.autoreload from tornado.escape import json_encode, json_decode -import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, urlparse, pycurl +import safeurl, types, sys, re, mimetypes, glob, jsbeautifier, pycurl +from urllib.parse import urlparse import calendar, time, datetime from netaddr import * from collections import defaultdict from bs4 import BeautifulSoup -from cgi import escape +from html import escape #------------------------------------------------------------ # Base / Status Code Handlers