enforce data types in __init__

This commit is contained in:
David Vierra 2010-09-19 04:34:21 -10:00
parent 0e43264748
commit 75a29aeaea

2
nbt.py
View File

@ -49,7 +49,7 @@ class TAG_Value:
def __init__(self, value=0, name=None, data=""):
self.name=name
if(data==""):
self.value = value
self.value = self.dataType(value)
else:
(self.value,) = struct.unpack(self.fmt, data[0:struct.calcsize(self.fmt)]);