mirror of
https://git.freebsd.org/ports.git
synced 2025-05-13 07:41:50 -04:00
News: https://git.notmuchmail.org/git?p=notmuch;a=blob_plain;f=NEWS;hb=81e9eaa273203553a494c6e92f69f08382d58889 Sponsored by: The FreeBSD Foundation
23 lines
742 B
Python
23 lines
742 B
Python
--- contrib/python-legacy/docs/source/conf.py.orig 2025-03-15 22:04:35 UTC
|
|
+++ contrib/python-legacy/docs/source/conf.py
|
|
@@ -13,7 +13,19 @@ import sys, os
|
|
|
|
import sys, os
|
|
|
|
-from unittest.mock import Mock
|
|
+try:
|
|
+ from unittest.mock import Mock
|
|
+except ImportError:
|
|
+ class Mock(object):
|
|
+ def __init__(self, *args, **kwargs):
|
|
+ pass
|
|
+
|
|
+ def __call__(self, *args, **kwargs):
|
|
+ return Mock()
|
|
+
|
|
+ @classmethod
|
|
+ def __getattr__(self, name):
|
|
+ return Mock() if name not in ('__file__', '__path__') else '/dev/null'
|
|
|
|
# If extensions (or modules to document with autodoc) are in another directory,
|
|
# add these directories to sys.path here. If the directory is relative to the
|