diff options
author | Christian Heimes <christian@python.org> | 2021-01-12 19:52:24 +0100 |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2021-03-04 11:26:20 +0100 |
commit | 2be0182d145d086306435f30ab997711bb5b3fb1 (patch) | |
tree | 5b4bcfa8bf07ebb3d6b198915c873f7bbe02f81b /tests.py | |
parent | 06d7ab2c5c19472a8cc7d5184a264873cb8fa972 (diff) | |
download | defusedxml-git-2be0182d145d086306435f30ab997711bb5b3fb1.tar.gz |
Drop Python 2 support
Diffstat (limited to 'tests.py')
-rw-r--r-- | tests.py | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -19,8 +19,6 @@ from defusedxml import ( ExternalReferenceForbidden, NotSupportedError, ) -from defusedxml.common import PY3 - if sys.version_info < (3, 7): warnings.filterwarnings("once", category=DeprecationWarning) @@ -62,11 +60,7 @@ os.environ["ftp_proxy"] = os.environ["http_proxy"] class DefusedTestCase(unittest.TestCase): - - if PY3: - content_binary = False - else: - content_binary = True + content_binary = False xml_dtd = os.path.join(HERE, "xmltestdata", "dtd.xml") xml_external = os.path.join(HERE, "xmltestdata", "external.xml") @@ -280,19 +274,13 @@ class TestDefusedSax(BaseTests): dtd_external_ref = True def parse(self, xmlfile, **kwargs): - if PY3: - result = io.StringIO() - else: - result = io.BytesIO() + result = io.StringIO() handler = XMLGenerator(result) self.module.parse(xmlfile, handler, **kwargs) return result.getvalue() def parseString(self, xmlstring, **kwargs): - if PY3: - result = io.StringIO() - else: - result = io.BytesIO() + result = io.StringIO() handler = XMLGenerator(result) self.module.parseString(xmlstring, handler, **kwargs) return result.getvalue() |