From fb1b58c7c0b5a2771a6056a1027e49d279bd09f1 Mon Sep 17 00:00:00 2001 From: Dirk Eschler Date: Fri, 16 Nov 2012 00:46:04 +0100 Subject: [PATCH] Added broader exception handling in version determination to see if this fixes build problems on rtd. --- docs/modeltranslation/conf.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/modeltranslation/conf.py b/docs/modeltranslation/conf.py index e9eb939..d1edf61 100644 --- a/docs/modeltranslation/conf.py +++ b/docs/modeltranslation/conf.py @@ -28,7 +28,18 @@ try: version = '.'.join(str(i) for i in modeltranslation.VERSION[:2]) # The full PEP386-compliant version number version, including # normalized alpha/beta/rc/dev tags (e.g. '0.5a1'). - release = modeltranslation.get_version() + try: + # FIXME: Can we make this work on services like read-the-docs? + # The build script on rtf bails out early with: + # + # Failed to import project; skipping build. + # Please make sure your repo is correct and you have a conf.py + # + release = modeltranslation.get_version() + except: + # We are broad here with the exception handling because we don't know + # the environment we build on. + release = version except ImportError: version = 'dev' release = 'dev'