def attach_enctype_error_multidict(request):
 oldcls = request.files.__class__
 class newcls(oldcls, ):
  def __getitem__(self, key):
   try:
    return oldcls.__getitem__(self, key)
   except KeyError as e:
    if (key not in request.form):
     raise
    raise DebugFilesKeyError(request, key)
 newcls.__name__ = oldcls.__name__
 newcls.__module__ = oldcls.__module__
 request.files.__class__ = newcls

def attach_enctype_error_multidict ( request ) : oldcls = request . files . __class__ class newcls ( oldcls , ) : def __getitem__ ( self , key ) : try : return oldcls . __getitem__ ( self , key ) except KeyError as e : if ( key not in request . form ) : raise raise DebugFilesKeyError ( request , key ) newcls . __name__ = oldcls . __name__ newcls . __module__ = oldcls . __module__ request . files . __class__ = newcls
since flask 0 .