Skip to content

Commit 6d3546a

Browse files
author
Emanuele Palazzetti
authored
[docs] fix pymemcache documentation build (#544)
1 parent aef5f22 commit 6d3546a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

ddtrace/contrib/pymemcache/__init__.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@
2121
# Use a pin to specify metadata related to this particular client
2222
Pin.override(client, service='my-memcached-service')
2323
24-
Pymemcache's ``HashClient`` will also be indirectly patched as it uses
25-
``Client``s under the hood.
24+
Pymemcache ``HashClient`` will also be indirectly patched as it uses ``Client``
25+
under the hood.
2626
"""
27+
from ...utils.importlib import require_modules
2728

28-
from .patch import patch, unpatch
2929

30-
__all__ = [patch, unpatch]
30+
required_modules = ['pymemcache']
31+
32+
with require_modules(required_modules) as missing_modules:
33+
if not missing_modules:
34+
from .patch import patch, unpatch
35+
__all__ = [
36+
patch,
37+
unpatch,
38+
]

0 commit comments

Comments
 (0)