Skip to content

Commit

Permalink
BUG: Guard formatting of __init__.__doc__ string (#738)
Browse files Browse the repository at this point in the history
I have no clue why it can be None, but it aparently can be None.

Closes #737
  • Loading branch information
MartinThoma committed Apr 12, 2022
1 parent 966eb5d commit 1f63d41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PyPDF2/pagerange.py
Expand Up @@ -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):
Expand Down

0 comments on commit 1f63d41

Please sign in to comment.