-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: Use Python 3.6 language features (#849)
As support for Python 3.5 and lower was dropped, we can use more modern syntax
- Loading branch information
1 parent
5c9df42
commit cd495f7
Showing
20 changed files
with
49 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2006, Mathieu Fenniak | ||
# Copyright (c) 2007, Ashish Kulkarni <[email protected]> | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2006, Mathieu Fenniak | ||
# Copyright (c) 2007, Ashish Kulkarni <[email protected]> | ||
# | ||
|
@@ -168,7 +166,7 @@ def producer_raw(self): | |
return self.get(DI.PRODUCER) | ||
|
||
|
||
class PdfFileReader(object): | ||
class PdfFileReader: | ||
""" | ||
Initialize a PdfFileReader object. | ||
|
@@ -862,7 +860,7 @@ def cacheGetIndirectObject(self, generation, idnum): | |
|
||
def cacheIndirectObject(self, generation, idnum, obj): | ||
if (generation, idnum) in self.resolvedObjects: | ||
msg = "Overwriting cache for %s %s" % (generation, idnum) | ||
msg = f"Overwriting cache for {generation} {idnum}" | ||
if self.strict: | ||
raise PdfReadError(msg) | ||
else: | ||
|
@@ -900,7 +898,7 @@ def read(self, stream): | |
raise PdfReadError("Broken xref table") | ||
else: | ||
warnings.warn( | ||
"incorrect startxref pointer({})".format(xref_issue_nr), PdfReadWarning | ||
f"incorrect startxref pointer({xref_issue_nr})", PdfReadWarning | ||
) | ||
|
||
# read all cross reference tables and their trailers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2006, Mathieu Fenniak | ||
# Copyright (c) 2007, Ashish Kulkarni <[email protected]> | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2006, Mathieu Fenniak | ||
# Copyright (c) 2007, Ashish Kulkarni <[email protected]> | ||
# | ||
|
@@ -69,7 +67,7 @@ | |
logger = logging.getLogger(__name__) | ||
|
||
|
||
class PdfFileWriter(object): | ||
class PdfFileWriter: | ||
""" | ||
This class supports writing PDF files out, given pages produced by another | ||
class (typically :class:`PdfFileReader<PdfFileReader>`). | ||
|
@@ -634,7 +632,7 @@ def _sweepIndirectReferences(self, externMap, data): | |
else: | ||
if hasattr(data.pdf, "stream") and data.pdf.stream.closed: | ||
raise ValueError( | ||
"I/O operation on closed file: {}".format(data.pdf.stream.name) | ||
f"I/O operation on closed file: {data.pdf.stream.name}" | ||
) | ||
newobj = ( | ||
externMap.get(data.pdf, {}) | ||
|
@@ -771,7 +769,7 @@ def addBookmark( | |
bold=False, | ||
italic=False, | ||
fit="/Fit", | ||
*args | ||
*args, | ||
): | ||
""" | ||
Add a bookmark to this PDF file. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
import string | ||
from itertools import product as cartesian_product | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
from io import BytesIO | ||
|
||
import pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.