From 81d90d7fb725007783a419eeaaf30dcac8a3c6fa Mon Sep 17 00:00:00 2001 From: bret curtis Date: Tue, 27 Feb 2018 18:57:37 +0100 Subject: [PATCH] break for all errors that would raise when checking for version, make them UNRELEASED --- docs/source/conf.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e3fe58bc7c..0ba8567c08 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -60,6 +60,9 @@ copyright = u'2017, OpenMW Team' # The short X.Y version. # The full version, including alpha/beta/rc tags. +release = version = "UNRELEASED" + + def get_openmw_version(haystack): needle = 'OPENMW_VERSION_MAJOR' line_counter = 0 @@ -68,9 +71,6 @@ def get_openmw_version(haystack): break line_counter += 1 - if line_counter == 0: - raise ImportError('Unable to find OpenMW Version') - version = '.'.join([haystack[line_counter][1][1].contents, haystack[line_counter+1][1][1].contents, haystack[line_counter+2][1][1].contents]) @@ -83,9 +83,9 @@ try: cmake_data = parsing.parse(cmake_raw) release = version = get_openmw_version(cmake_data) -except ImportError: - release = "UNRELEASED" - print("WARNING: Unable to import parse_cmake, version will be set to: {0}.".format(release)) +except Exception as ex: + print("WARNING: Version will be set to '{0}' because: '{1}'.".format(release, str(ex))) + import traceback; traceback.print_exc() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.