mirror of https://github.com/MISP/PyMISP
parent
9df636cd37
commit
7912df8f37
|
@ -336,6 +336,9 @@ class MISPAttribute(AbstractMISP):
|
||||||
|
|
||||||
@data.setter
|
@data.setter
|
||||||
def data(self, data):
|
def data(self, data):
|
||||||
|
if sys.version_info <= (3, ):
|
||||||
|
if isinstance(data, unicode):
|
||||||
|
self._data = BytesIO(base64.b64decode(data.encode()))
|
||||||
if sys.version_info >= (3, 6):
|
if sys.version_info >= (3, 6):
|
||||||
if isinstance(data, Path):
|
if isinstance(data, Path):
|
||||||
with data.open('rb') as f:
|
with data.open('rb') as f:
|
||||||
|
|
Loading…
Reference in New Issue