py3 compat

This commit is contained in:
Kovid Goyal 2020-09-11 13:35:11 +05:30
parent 3946727192
commit 66b10927fb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -30,6 +30,8 @@ def set_data(name, val):
editors[name].replace_data(val, only_if_different=False)
else:
with current_container().open(name, 'wb') as f:
if isinstance(val, str):
val = val.encode('utf-8')
f.write(val)
get_boss().set_modified()