Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d4565f4

Browse filesBrowse files
authored
Merge pull request #14617 from anntzer/py24
Remove a Py2.4(!) backcompat fix.
2 parents 5c413df + c32065d commit d4565f4
Copy full SHA for d4565f4

File tree

Expand file treeCollapse file tree

1 file changed

+2
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-10
lines changed

‎lib/matplotlib/backends/backend_pdf.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_pdf.py
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -938,19 +938,11 @@ def embedTTFType3(font, characters, descriptor):
938938
'Widths': widthsObject
939939
}
940940

941-
# Make the "Widths" array
942941
from encodings import cp1252
943-
# The "decoding_map" was changed
944-
# to a "decoding_table" as of Python 2.5.
945-
if hasattr(cp1252, 'decoding_map'):
946-
def decode_char(charcode):
947-
return cp1252.decoding_map[charcode] or 0
948-
else:
949-
def decode_char(charcode):
950-
return ord(cp1252.decoding_table[charcode])
951942

943+
# Make the "Widths" array
952944
def get_char_width(charcode):
953-
s = decode_char(charcode)
945+
s = ord(cp1252.decoding_table[charcode])
954946
width = font.load_char(
955947
s, flags=LOAD_NO_SCALE | LOAD_NO_HINTING).horiAdvance
956948
return cvt(width)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.