File tree Expand file tree Collapse file tree 1 file changed +22
-21
lines changed
Expand file tree Collapse file tree 1 file changed +22
-21
lines changed Original file line number Diff line number Diff line change 1616import sys
1717import os
1818
19+ # -- Mock module for _sane
20+ try :
21+ try :
22+ # Python >= 3.3
23+ from unittest .mock import MagicMock
24+ except :
25+ try :
26+ # Python < 3.3
27+ from mock import Mock as MagicMock
28+ except :
29+ raise ImportError
30+
31+ class Mock (MagicMock ):
32+ @classmethod
33+ def __getattr__ (cls , name ):
34+ return Mock ()
35+
36+ sys .modules .update ([('_sane' , Mock ())])
37+ except :
38+ pass
39+
40+
1941# If extensions (or modules to document with autodoc) are in another directory,
2042# add these directories to sys.path here. If the directory is relative to the
2143# documentation root, use os.path.abspath to make it absolute, like shown here.
262284
263285# If true, do not generate a @detailmenu in the "Top" node's menu.
264286#texinfo_no_detailmenu = False
265-
266- # -- Mock modules for readthedocs
267- try :
268- try :
269- # Python >= 3.3
270- from unittest .mock import MagicMock
271- except :
272- try :
273- # Python < 3.3
274- from mock import Mock as MagicMock
275- except :
276- raise ImportError
277-
278- class Mock (MagicMock ):
279- @classmethod
280- def __getattr__ (cls , name ):
281- return Mock ()
282-
283- sys .modules .update ([('_sane' , Mock ())])
284- except :
285- pass
You can’t perform that action at this time.
0 commit comments