Skip to content
Prev Previous commit
Next Next commit
Fix doc builds.
  • Loading branch information
anntzer committed Jan 9, 2018
commit ab61783390f2d8ffad98c38f86e3d406d67e28ca
40 changes: 21 additions & 19 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,8 @@ def _check_deps():
]


class MyWX(MagicMock):
class Panel(object):
pass

class ToolBar(object):
pass

class Frame(object):
pass

VERSION_STRING = '2.9'
class MyCairo(MagicMock):
version_info = (1, 2, 0)


class MyPyQt4(MagicMock):
Expand Down Expand Up @@ -450,14 +441,25 @@ def getapi(*args):
return 1


mockwxversion = MagicMock()
mockwx = MyWX()
mocksip = MySip()
mockpyqt4 = MyPyQt4()
sys.modules['wxversion'] = mockwxversion
sys.modules['wx'] = mockwx
sys.modules['sip'] = mocksip
sys.modules['PyQt4'] = mockpyqt4
class MyWX(MagicMock):
class Panel(object):
pass

class ToolBar(object):
pass

class Frame(object):
pass

VERSION_STRING = '2.9'


sys.modules['cairo'] = MyCairo()
sys.modules['cairo'].__name__ = 'cairocffi'
sys.modules['PyQt4'] = MyPyQt4()
sys.modules['sip'] = MySip()
sys.modules['wx'] = MyWX()
sys.modules['wxversion'] = MagicMock()

# numpydoc config

Expand Down
3 changes: 1 addition & 2 deletions lib/matplotlib/backends/backend_cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
import numpy as np

# In order to make it possible to pick the binding, use whichever has already
# been imported, if any. (The intermediate call to iter is just to placate
# Python2.)
# been imported, if any.
cairo = next(
(mod for mod in (
sys.modules.get(name) for name in ["cairocffi", "cairo"]) if mod),
Expand Down