splitext includes leading dot

This commit is contained in:
Martin Diehl 2020-01-03 14:44:31 +01:00
parent 326e3d0824
commit b5e4e42505
1 changed files with 1 additions and 1 deletions

View File

@ -422,7 +422,7 @@ class Geom():
ext = os.path.splitext(fname)[1]
if ext == '':
name = fname + '.' + writer.GetDefaultFileExtension()
elif ext == writer.GetDefaultFileExtension():
elif ext[1:] == writer.GetDefaultFileExtension():
name = fname
else:
raise ValueError("unknown extension {}".format(ext))