Skip to content

Commit

Permalink
BUG: Fix deprecation warning on using PdfMerger
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOdin committed May 23, 2022
1 parent 000ac49 commit 6a7a591
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PyPDF2/merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from sys import version_info

from PyPDF2._reader import PdfReader
from PyPDF2._utils import DEPR_MSG, isString, str_
from PyPDF2._utils import _isString, DEPR_MSG, str_
from PyPDF2._writer import PdfWriter
from PyPDF2.constants import PagesAttributes as PA
from PyPDF2.generic import *
Expand Down Expand Up @@ -130,7 +130,7 @@ def merge(
# BytesIO (or StreamIO) stream.
# If fileobj is none of the above types, it is not modified
decryption_key = None
if isString(fileobj):
if _isString(fileobj):
fileobj = file(fileobj, "rb")
my_file = True
elif hasattr(fileobj, "seek") and hasattr(fileobj, "read"):
Expand Down Expand Up @@ -185,7 +185,7 @@ def merge(
else:
self.bookmarks += outline

dests = reader.namedDestinations
dests = reader.named_destinations
trimmed_dests = self._trim_dests(reader, dests, pages)
self.named_dests += trimmed_dests

Expand Down Expand Up @@ -241,7 +241,7 @@ def write(self, fileobj):
file-like object.
"""
my_file = False
if isString(fileobj):
if _isString(fileobj):
fileobj = file(fileobj, "wb")
my_file = True

Expand Down

0 comments on commit 6a7a591

Please sign in to comment.