Skip to content

Commit 44d1aa4

Browse files
committed
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__`.
1 parent 3df72de commit 44d1aa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_html/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
__version__ = get_distribution(__name__).version
66
except DistributionNotFound:
77
# package is not installed
8-
pass
8+
__version__ = 'unknown'
99

1010
__pypi_url__ = 'https://pypi.python.org/pypi/pytest-html'

0 commit comments

Comments
 (0)