From: Ole Streicher <olebole@debian.org>
Date: Sun, 8 Dec 2019 20:05:03 +0100
Subject: Initialize __version__ with None if version info is unavailable

---
 gammapy/__init__.py         | 3 ++-
 gammapy/scripts/download.py | 3 ---
 gammapy/scripts/info.py     | 3 ++-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/gammapy/__init__.py b/gammapy/__init__.py
index 114af9c..13f92a1 100644
--- a/gammapy/__init__.py
+++ b/gammapy/__init__.py
@@ -41,7 +41,8 @@ try:
     __version__ = version(__name__)
 except PackageNotFoundError:
     # package is not installed
-    pass
+    __version__ = None
+
 del version, PackageNotFoundError
 
 
diff --git a/gammapy/scripts/download.py b/gammapy/scripts/download.py
index b4e97f4..b796c21 100644
--- a/gammapy/scripts/download.py
+++ b/gammapy/scripts/download.py
@@ -17,9 +17,6 @@ GAMMAPY_BASE_URL = "https://gammapy.org/download/"
 
 RELEASE = __version__
 
-if "dev" in __version__:
-    RELEASE = "dev"
-
 
 class DownloadIndex:
     """Download index."""
diff --git a/gammapy/scripts/info.py b/gammapy/scripts/info.py
index 06c7fc1..27fcb8a 100644
--- a/gammapy/scripts/info.py
+++ b/gammapy/scripts/info.py
@@ -69,7 +69,8 @@ def print_info(info, title):
     info_all = f"\n{title}:\n\n"
 
     for key, value in info.items():
-        info_all += f"\t{key:22s} : {value:<10s} \n"
+        if value is not None:
+            info_all += f"\t{key:22s} : {value:<10s} \n"
 
     print(info_all)
 
