def _check_pil_jpeg_bytes():
 from PIL import Image
 buf = BytesIO()
 img = Image.new('RGB', (4, 4))
 try:
  img.save(buf, 'jpeg')
 except Exception as e:
  ename = e.__class__.__name__
  raise SkipTest(("PIL can't write JPEG to BytesIO: %s: %s" % (ename, e)))

def _check_pil_jpeg_bytes ( ) : from PIL import Image buf = BytesIO ( ) img = Image . new ( 'RGB' , ( 4 , 4 ) ) try : img . save ( buf , 'jpeg' ) except Exception as e : ename = e . __class__ . __name__ raise SkipTest ( ( "PIL can't write JPEG to BytesIO: %s: %s" % ( ename , e ) ) )
skip if pil cant write jpegs to bytesio objects .