From 8b973064d19cc04e4e39ef0714f894c1d4b6d278 Mon Sep 17 00:00:00 2001 From: Mark Mossberg Date: Mon, 24 Apr 2017 17:06:47 -0400 Subject: [PATCH] Add read the docs mock (#180) * Add read the docs mock * Only mock if 'z3 in first arg to check_output --- docs/conf.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 0f195a7..6a55d34 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -153,4 +153,19 @@ texinfo_documents = [ ] +# -- Custom + +# mock z3 existence so readthedocs will not error out when +# generating docs + +import subprocess + +saved_check_output = subprocess.check_output +def z3_mock_check_output(*args, **kwargs): + if args and 'z3' in args[0]: + return 'Z3 Version 4.4.2' + + return saved_check_output(*args, **kwargs) + +subprocess.check_output = z3_mock_check_output