diff --git a/docs/source/conf.py b/docs/source/conf.py index 05471e5..76d00c6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -8,6 +8,13 @@ import ctypes +# Monkey-patch PROT_READ into mmap if missing (Windows), so that we can +# import mss.linux.xshmgetimage while building the documentation. +import mmap + +if not hasattr(mmap, "PROT_READ"): + mmap.PROT_READ = 1 # type:ignore[attr-defined] + import mss # -- General configuration ------------------------------------------------ @@ -44,7 +51,6 @@ ctypes.WINFUNCTYPE = ctypes.CFUNCTYPE # type:ignore[attr-defined] ctypes.WinError = lambda _code=None, _descr=None: OSError() # type:ignore[attr-defined] - # -- Options for HTML output ---------------------------------------------- html_theme = "shibuya"