Skip to content
Merged
Next Next commit
fmt_docstrings: Use string.Template for docstring placeholders
  • Loading branch information
seisman committed Nov 15, 2025
commit bb241359138bdb830c888941cb0015c5f67043a3
4 changes: 2 additions & 2 deletions pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import functools
import string
import textwrap
import warnings
from inspect import Parameter, signature
Expand Down Expand Up @@ -467,8 +468,7 @@ def fmt_docstring(module_func):
# Dedent the docstring to make it all match the option text.
docstring = textwrap.dedent(module_func.__doc__)

module_func.__doc__ = docstring.format(**filler_text)

module_func.__doc__ = string.Template(docstring).safe_substitute(**filler_text)
return module_func


Expand Down