diff --git a/PyPDF2/pagerange.py b/PyPDF2/pagerange.py index 15ac787bf..379ee787c 100644 --- a/PyPDF2/pagerange.py +++ b/PyPDF2/pagerange.py @@ -83,7 +83,8 @@ def __init__(self, arg): self._slice = slice(*[int(g) if g else None for g in m.group(4, 6, 8)]) - __init__.__doc__ = __init__.__doc__.format(page_range_help=PAGE_RANGE_HELP) + if __init__.__doc__: # see https://github.com/py-pdf/PyPDF2/issues/737 + __init__.__doc__ = __init__.__doc__.format(page_range_help=PAGE_RANGE_HELP) @staticmethod def valid(input):