Skip to content

Commit

Permalink
MNT : retain 'replace' and 2.6 compat
Browse files Browse the repository at this point in the history
Per https://docs.python.org/2/library/stdtypes.html#str.decode
the error handling arg was added in 2.2, but support for kwarg was
only added in 2.7
  • Loading branch information
tacaswell committed Dec 12, 2014
1 parent addc51e commit 0b5aae2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/matplotlib/type1font.py
Expand Up @@ -216,7 +216,7 @@ def _parse(self):
# The spec calls this an ASCII format; in Python 2.x we could
# just treat the strings and names as opaque bytes but let's
# turn them into proper Unicode, and be lenient in case of high bytes.
convert = lambda x: x.decode('ascii')
convert = lambda x: x.decode('ascii', 'replace')
for token, value in filtered:
if token is self._name and value.startswith(b'/'):
key = convert(value[1:])
Expand Down

0 comments on commit 0b5aae2

Please sign in to comment.