Skip to content

Commit 9b0c9c0

Browse files
committed
Move compat import to supervisor.compat with all the others
1 parent 8e5be01 commit 9b0c9c0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

supervisor/compat.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,8 @@ def is_text_stream(stream):
105105
import thread
106106
except ImportError: # pragma: no cover
107107
import _thread as thread
108+
109+
try: # pragma: no cover
110+
from html import escape
111+
except ImportError: # pragma: no cover
112+
from cgi import escape

supervisor/medusa/util.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
from supervisor.compat import PY2
2-
3-
if PY2:
4-
from cgi import escape
5-
else:
6-
from html import escape
7-
1+
from supervisor.compat import escape
82

93
def html_repr (object):
104
so = escape (repr (object))

0 commit comments

Comments
 (0)