From 522c8f13d714fdca8a5fc9197b43a54444c2353c Mon Sep 17 00:00:00 2001 From: Barbara Kemper Date: Fri, 22 Aug 2025 11:26:49 -0400 Subject: [PATCH] update references to deprecated cgi package Signed-off-by: Barbara Kemper --- swat/dataframe.py | 5 +---- swat/notebook/zeppelin.py | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) mode change 100644 => 100755 swat/dataframe.py mode change 100644 => 100755 swat/notebook/zeppelin.py diff --git a/swat/dataframe.py b/swat/dataframe.py old mode 100644 new mode 100755 index af1be861..3f535caa --- a/swat/dataframe.py +++ b/swat/dataframe.py @@ -788,10 +788,7 @@ def to_html(self, apply_formats=None, **kwargs): def _post_process_html(self, html): ''' Add SAS-isms to generated HTML table ''' - try: - from html import escape - except ImportError: - from cgi import escape + from html import escape # Add table label if self.label: diff --git a/swat/notebook/zeppelin.py b/swat/notebook/zeppelin.py old mode 100644 new mode 100755 index 33505a11..8c74239f --- a/swat/notebook/zeppelin.py +++ b/swat/notebook/zeppelin.py @@ -24,7 +24,7 @@ from __future__ import print_function, division, absolute_import, unicode_literals import base64 -import cgi +import html import pandas as pd import pprint import six @@ -77,7 +77,7 @@ def show(obj, **kwargs): show_svg(obj, **kwargs) else: - print('%%html
%s
' % cgi.escape(pprint.pformat(obj))) + print('%%html
%s
' % html.escape(pprint.pformat(obj))) def show_image(img, fmt='png', width='auto', height='auto'):