From 4edb912401c70c1dde143e59a410f33ace39eae9 Mon Sep 17 00:00:00 2001 From: Christian Stefanescu Date: Sun, 3 Jul 2022 15:25:34 +0200 Subject: [PATCH] Remove Python 2.x imports --- CHANGELOG.md | 1 + untangle.py | 15 +++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17f24f7..bf96294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Changelog --------- Unreleased +- remove Python 2.x imports ([#96](https://github.com/stchris/untangle/pull/96)) 1.2.1 - (SECURITY) Use [defusedxml](https://github.com/tiran/defusedxml) to prevent XML SAX vulnerabilities ([#94](https://github.com/stchris/untangle/pull/94)) diff --git a/untangle.py b/untangle.py index 68525a3..0e1b9bc 100755 --- a/untangle.py +++ b/untangle.py @@ -19,20 +19,11 @@ from xml.sax import handler -try: - from StringIO import StringIO -except ImportError: - from io import StringIO -try: - from types import StringTypes +from io import StringIO - def is_string(x): - return isinstance(x, StringTypes) -except ImportError: - - def is_string(x): - return isinstance(x, str) +def is_string(x): + return isinstance(x, str) __version__ = "1.2.1"