Skip to content

Commit

Permalink
BUG: Fix formatWarning for filename without slash (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
timitos authored Apr 6, 2022
1 parent f5ab1a3 commit b17db79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def isBytes(b):

#custom implementation of warnings.formatwarning
def formatWarning(message, category, filename, lineno, line=None):
file = filename.replace("/", "\\").rsplit("\\", 1)[1] # find the file name
file = filename.replace("/", "\\").rsplit("\\", 1)[-1] # find the file name
return "%s: %s [%s:%s]\n" % (category.__name__, message, file, lineno)


Expand Down

0 comments on commit b17db79

Please sign in to comment.