File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 249
249
250
250
# If true, do not generate a @detailmenu in the "Top" node's menu.
251
251
#texinfo_no_detailmenu = False
252
+
253
+ class CExtMock (object ):
254
+ """Required for autodoc on readthedocs.org where you cannot build C extensions."""
255
+ def __init__ (self , * args , ** kwargs ):
256
+ pass
257
+
258
+ def __call__ (self , * args , ** kwargs ):
259
+ return CExtMock ()
260
+
261
+ @classmethod
262
+ def __getattr__ (cls , name ):
263
+ if name in ('__file__' , '__path__' ):
264
+ return '/dev/null'
265
+ else :
266
+ return CExtMock ()
267
+
268
+ try :
269
+ import lxml # flake8: noqa
270
+ except ImportError :
271
+ sys .modules ['lxml' ] = CExtMock ()
272
+ sys .modules ['lxml.etree' ] = CExtMock ()
273
+ print ("warning: lxml modules mocked." )
274
+
275
+ try :
276
+ import genshi # flake8: noqa
277
+ except ImportError :
278
+ sys .modules ['genshi' ] = CExtMock ()
279
+ sys .modules ['genshi.core' ] = CExtMock ()
280
+ print ("warning: genshi modules mocked." )
You can’t perform that action at this time.
0 commit comments