diff options
author | Christian Heimes <christian@cheimes.de> | 2013-02-12 15:00:59 +0100 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-02-12 15:00:59 +0100 |
commit | c1be037e46ec1738c2f2a91b9d46ad05d847f77f (patch) | |
tree | 6fc1643e050105606ad4fb1c565821382fd3aefc /tests.py | |
parent | e2b6fcee0126c423fe98a81aee3cd5c7349fc43c (diff) | |
download | defusedxml-c1be037e46ec1738c2f2a91b9d46ad05d847f77f.tar.gz |
fixed externel file ref test on Python 3.x
Diffstat (limited to 'tests.py')
-rw-r--r-- | tests.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -116,7 +116,11 @@ class BaseTests(unittest.TestCase): def test_external_file_ref(self): content = self.get_content(self.xml_external_file) - content = content.replace("/PATH/TO", HERE) + if isinstance(content, bytes): + here = HERE.encode(sys.getfilesystemencoding()) + content = content.replace(b"/PATH/TO", here) + else: + content = content.replace("/PATH/TO", HERE) self.assertRaises(self.external_ref_exception, self.parseString, content, forbid_entities=False) |