Skip to content

Commit 4edb912

Browse files
committed
Remove Python 2.x imports
1 parent e988ee2 commit 4edb912

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Changelog
22
---------
33

44
Unreleased
5+
- remove Python 2.x imports ([#96](https://github.com/stchris/untangle/pull/96))
56

67
1.2.1
78
- (SECURITY) Use [defusedxml](https://github.com/tiran/defusedxml) to prevent XML SAX vulnerabilities ([#94](https://github.com/stchris/untangle/pull/94))

untangle.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,11 @@
1919
from xml.sax import handler
2020

2121

22-
try:
23-
from StringIO import StringIO
24-
except ImportError:
25-
from io import StringIO
26-
try:
27-
from types import StringTypes
22+
from io import StringIO
2823

29-
def is_string(x):
30-
return isinstance(x, StringTypes)
3124

32-
except ImportError:
33-
34-
def is_string(x):
35-
return isinstance(x, str)
25+
def is_string(x):
26+
return isinstance(x, str)
3627

3728

3829
__version__ = "1.2.1"

0 commit comments

Comments
 (0)