Skip to content

Commit

Permalink
Pleasing Pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Sep 18, 2021
1 parent 4ae2f12 commit 7055d73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions fpdf/fpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2728,10 +2728,10 @@ def _putfonts(self):
code_high = 0xD800 | (code - 0x10000) >> 10
code_low = 0xDC00 | (code & 0x3FF)
bfChar.append(
"<%04X> <%04X%04X>\n" % (code_mapped, code_high, code_low)
f"<{code_mapped:04X}> <{code_high:04X}{code_low:04X}>\n"
)
else:
bfChar.append("<%04X> <%04X>\n" % (code_mapped, code))
bfChar.append(f"<{code_mapped:04X}> <{code:04X}>\n")

# ToUnicode
self._newobj()
Expand Down
3 changes: 1 addition & 2 deletions fpdf/ttfonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ def makeSubset(self, file, subset):
target = subset[code] if isinstance(subset, dict) else code
if target > 65535:
raise Exception(
"Character U+%X must be remapped since it cannot be indexed in CMAP4 table"
% target
f"Character U+{target:X} must be remapped since it cannot be indexed in CMAP4 table"
)
if code in self.charToGlyph:
if (self.charToGlyph[code], target) not in subsetglyphs:
Expand Down
2 changes: 1 addition & 1 deletion test/image/test_image_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def break_down_filename(image):

def test_get_img_info():
short_keys = {"f", "h", "bpc", "w", "cs", "trns", "dp", "pal"}
expected = json.loads((HERE / "image_info.json").read_text())
expected = json.loads((HERE / "image_info.json").read_text(encoding='utf8'))

for path in sorted((HERE / "png_test_suite").glob("*.png")):
if not path.stem.startswith("x"):
Expand Down

0 comments on commit 7055d73

Please sign in to comment.