mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
fix PIL import
This commit is contained in:
parent
0a2e7a97cd
commit
3aa8d42b05
@ -20,12 +20,12 @@ import logging
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import PIL
|
|
||||||
import html2text
|
import html2text
|
||||||
import lxml.etree
|
import lxml.etree
|
||||||
import lxml.html
|
import lxml.html
|
||||||
import six
|
import six
|
||||||
from PIL import ExifTags
|
from PIL import ExifTags
|
||||||
|
from PIL import Image
|
||||||
from six.moves import cStringIO as StringIO
|
from six.moves import cStringIO as StringIO
|
||||||
|
|
||||||
from mitmproxy import exceptions
|
from mitmproxy import exceptions
|
||||||
@ -403,7 +403,7 @@ class ViewImage(View):
|
|||||||
|
|
||||||
def __call__(self, data, **metadata):
|
def __call__(self, data, **metadata):
|
||||||
try:
|
try:
|
||||||
img = PIL.Image.open(StringIO(data))
|
img = Image.open(StringIO(data))
|
||||||
except IOError:
|
except IOError:
|
||||||
return None
|
return None
|
||||||
parts = [
|
parts = [
|
||||||
|
Loading…
Reference in New Issue
Block a user