From e6c70634755a04368a08bdb9df554db3a1506051 Mon Sep 17 00:00:00 2001 From: Matt Wilkie Date: Sat, 13 Jun 2015 22:33:45 -0700 Subject: [PATCH] gracefully fall back from py3 (#48) ...kind of a pointless nicety since neither seem to work, but... --- docs/source/conf.py | 10 ++++++---- docs/source/index.rst.leo | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 10b0238..f37239d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -17,11 +17,13 @@ import shlex # https://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules -#from mock import Mock as MagicMock - #py27 import -from unittest.mock import MagicMock +try: #py3 import - + from unittest.mock import MagicMock +except ImportError: + #py27 import + from mock import Mock as MagicMock + class Mock(MagickMock): @classmethod def __getattr__(cls, name): diff --git a/docs/source/index.rst.leo b/docs/source/index.rst.leo index ae89ce0..b1007c6 100644 --- a/docs/source/index.rst.leo +++ b/docs/source/index.rst.leo @@ -12,7 +12,7 @@ @persistence @data:@auto conf.py -@gnxs +@gnxs Apt - Read The Docs @@ -24,11 +24,11 @@ @path b:\code\apt\docs\source +gnx: maphew.20150613204824.3 +unl: conf declarations + gnx: maphew.20150613204824.2 -gnx: maphew.20150613204824.3 -unl: conf declarations -