diff --git a/nbt/nbt.py b/nbt/nbt.py index dec9ba0..d4a1290 100644 --- a/nbt/nbt.py +++ b/nbt/nbt.py @@ -8,8 +8,10 @@ try: unicode + basestring except NameError: unicode = str # compatibility for Python 3 + basestring = str # compatibility for Python 3 TAG_END = 0 diff --git a/tests/tests.py b/tests/tests.py index d937e32..f22aab3 100755 --- a/tests/tests.py +++ b/tests/tests.py @@ -22,7 +22,7 @@ def testEmptyFiles(self): Opening an empty file causes an uncaught exception. https://github.com/twoolie/NBT/issues/issue/4 """ - temp = BytesIO("") + temp = BytesIO(b"") temp.seek(0) self.assertRaises(MalformedFileError, NBTFile, buffer=temp) @@ -102,7 +102,7 @@ def tearDown(self): class EmptyStringTest(unittest.TestCase): def setUp(self): - self.golden_value = "\x0A\0\x04Test\x08\0\x0Cempty string\0\0\0" + self.golden_value = b"\x0A\0\x04Test\x08\0\x0Cempty string\0\0\0" self.nbtfile = NBTFile(buffer=BytesIO(self.golden_value)) def testReadEmptyString(self):