Skip to content
Snippets Groups Projects
Commit 4f3b182e authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Some fixes from the futurize step 2.

parent c55f4531
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import object
from builtins import str
import numpy as np
import io
import logging
......@@ -78,8 +79,8 @@ class LocalBackend(object):
# Check that the value is actually of scalar type
value_type = type(value)
if value_type not in [float, int, bool, type(b""), type(u""), np.float64]:
raise TypeError("The value '{}' for metainfo '{}' is not of scalar nature.".format(value, metaName))
if value_type not in [float, int, bool, type(b""), type(u""), str, np.float64]:
raise TypeError("The value '{}' with type '{}' for metainfo '{}' is not of scalar nature.".format(value, value_type, metaName))
# Check that the metainfo should be scalar
metainfo_shape = dataManager.metaInfo.shape
......@@ -168,7 +169,7 @@ class LocalBackend(object):
elif dtypeStr == "b":
return [bool]
elif dtypeStr == "C":
return [type(b""), type(u"")]
return [type(b""), type(u""), str]
elif dtypeStr == "r":
return [int]
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment