Commit 61702e88 authored by Denis Arrivault's avatar Denis Arrivault
Browse files

Assert utf8 encoding of version number is compatible with python 2.7

parent 61f46f3c
Pipeline #331 skipped
ltfatpy:1.0.1
ltfatpy:1.0.3
ltfat:2.1.0
......@@ -117,4 +117,4 @@ __all__ = ["arg_firwin", "assert_groworder", "assert_sigreshape_post",
"long2fir", "normalize", "rms", "thresh", "lcm", "postpad"]
__version__ = "1.0.1"
__version__ = "1.0.3"
......@@ -50,12 +50,12 @@ def get_version():
def set_version(ltfat_dir, VERSION):
filename = os.path.join(ltfat_dir, '__init__.py')
buf = ""
for line in open(filename, encoding="utf-8"):
if not line.startswith("__version__ ="):
buf += line
f = open(filename, "w", encoding="utf-8")
f.write(buf)
f.write('__version__ = "%s"\n' % VERSION)
for line in open(filename, "rb"):
if not line.decode("utf8").startswith("__version__ ="):
buf += line.decode("utf8")
f = open(filename, "wb")
f.write(buf.encode("utf8"))
f.write(('__version__ = "%s"\n' % VERSION).encode("utf8"))
#################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment