mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Update PpmImagePlugin.py
Making it work for Python 3.x
This commit is contained in:
parent
800729e092
commit
e70424644a
|
@ -24,11 +24,14 @@ from PIL import Image, ImageFile
|
|||
#
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
import locale
|
||||
locale_lang,locale_enc = locale.getlocale()
|
||||
if locale_enc is None:
|
||||
locale_lang,locale_enc = locale.getdefaultlocale()
|
||||
b_whitespace = string.whitespace.decode(locale_enc)
|
||||
b_whitespace = string.whitespace
|
||||
try:
|
||||
import locale
|
||||
locale_lang,locale_enc = locale.getlocale()
|
||||
if locale_enc is None:
|
||||
locale_lang,locale_enc = locale.getdefaultlocale()
|
||||
b_whitespace = b_whitespace.decode(locale_enc)
|
||||
except: pass
|
||||
b_whitespace = b_whitespace.encode('ascii','ignore')
|
||||
|
||||
MODES = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user