1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
From: Roland Mas <lolando@debian.org>
Date: Mon, 27 Sep 2021 19:28:24 +0200
Subject: Don't abort when failing to write version to disk
---
dioptas/version.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dioptas/version.py b/dioptas/version.py
index 38d89cc..802c8cd 100644
--- a/dioptas/version.py
+++ b/dioptas/version.py
@@ -40,7 +40,10 @@ def get_version():
version = "0.5.2"
else:
# trying to freeze the current version into a python file which gets loaded in case it is not accessible
- with open(os.path.join(dir_path, '__version__'), 'w+') as fp:
- fp.write(version)
+ try:
+ with open(os.path.join(dir_path, '__version__'), 'w+') as fp:
+ fp.write(version)
+ except:
+ pass
return version
|