forked from p34709852/monkey
fix unicode bug
This commit is contained in:
parent
225c7fae6f
commit
ac8f218586
|
@ -23,7 +23,7 @@ def _cast_by_example(value, example):
|
||||||
"""
|
"""
|
||||||
example_type = type(example)
|
example_type = type(example)
|
||||||
if example_type is str:
|
if example_type is str:
|
||||||
return str(os.path.expandvars(value))
|
return os.path.expandvars(value).encode("utf8")
|
||||||
elif example_type is tuple and len(example) != 0:
|
elif example_type is tuple and len(example) != 0:
|
||||||
if value is None or value == tuple(None):
|
if value is None or value == tuple(None):
|
||||||
return tuple()
|
return tuple()
|
||||||
|
|
Loading…
Reference in New Issue