Skip to content

Commit

Permalink
Remove Python 2.x imports
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed Jul 3, 2022
1 parent e988ee2 commit f0965bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Changelog
---------

Unreleased
- remove Python 2.x imports

1.2.1
- (SECURITY) Use [defusedxml](https://github.com/tiran/defusedxml) to prevent XML SAX vulnerabilities ([#94](https://github.com/stchris/untangle/pull/94))
Expand Down
15 changes: 3 additions & 12 deletions untangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f0965bd

Please sign in to comment.