changeset 2607:4c086cf7af66

core (version): added workaround for Pyjamas, avoiding crash when reading VERSION
author Goffi <goffi@goffi.org>
date Sun, 03 Jun 2018 13:54:35 +0200 (2018-06-03)
parents 6a261b725f71
children 0883bac573fd
files sat/__init__.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat/__init__.py	Sat Jun 02 17:29:55 2018 +0200
+++ b/sat/__init__.py	Sun Jun 03 13:54:35 2018 +0200
@@ -19,5 +19,9 @@
 import os.path
 
 version_file = os.path.join(os.path.dirname(__file__), 'VERSION')
-with open(version_file) as f:
-    __version__ = f.read().strip()
+try:
+    with open(version_file) as f:
+        __version__ = f.read().strip()
+except NotImplementedError:
+    # pyjamas workaround
+    __version__ = '0.7D'