Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c32065d

Browse files
committed
Remove a Py2.4(!) backcompat fix.
1 parent 3bacb5f commit c32065d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines 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)