From 44d1aa4bfa6e622c292a48256da848e317b04ac9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 17 Sep 2018 14:54:25 -0300 Subject: [PATCH] Always define __version__ even if get_distribution() fails In frozen executables such as pyinstaller, get_distribution() does not work because it looks for files in the environment which are not packed in the executable. This patch makes `__version__` available in those situations, otherwise the plugin won't work at all because `plugin.py` tries to import `__version__` from `pytest_html.__init__`. --- pytest_html/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_html/__init__.py b/pytest_html/__init__.py index d3a807ab..02c2adc2 100644 --- a/pytest_html/__init__.py +++ b/pytest_html/__init__.py @@ -5,6 +5,6 @@ __version__ = get_distribution(__name__).version except DistributionNotFound: # package is not installed - pass + __version__ = 'unknown' __pypi_url__ = 'https://pypi.python.org/pypi/pytest-html'