You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2004/04/30 21:26:36 UTC

cvs commit: httpd-python/lib/python/mod_python util.py

grisha      2004/04/30 12:26:36

  Modified:    lib/python/mod_python util.py
  Log:
  This patch fixes the problem by checking if the file has a "file"
  attribute itself, and checking the type of that.
  There may be a cleaner way to do it.
  
  Submitted by:	David Fraser
  
  Revision  Changes    Path
  1.22      +7 -4      httpd-python/lib/python/mod_python/util.py
  
  Index: util.py
  ===================================================================
  RCS file: /home/cvs/httpd-python/lib/python/mod_python/util.py,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- util.py	16 Feb 2004 19:47:27 -0000	1.21
  +++ util.py	30 Apr 2004 19:26:36 -0000	1.22
  @@ -224,7 +224,8 @@
           found = []
           for item in self.list:
               if item.name == key:
  -                if isinstance(item.file, FileType):
  +                if isinstance(item.file, FileType) or \
  +                       isinstance(getattr(item.file, 'file', None), FileType):
                       found.append(item)
                   else:
                       found.append(StringField(item.value))
  @@ -268,7 +269,8 @@
           """ return the first value received """
           for item in self.list:
               if item.name == key:
  -                if isinstance(item.file, FileType):
  +                if isinstance(item.file, FileType) or \
  +                       isinstance(getattr(item.file, 'file', None), FileType):
                       return item
                   else:
                       return StringField(item.value)
  @@ -281,7 +283,8 @@
           found = []
           for item in self.list:
               if item.name == key:
  -                if isinstance(item.file, FileType):
  +                if isinstance(item.file, FileType) or \
  +                       isinstance(getattr(item.file, 'file', None), FileType):
                       found.append(item)
                   else:
                       found.append(StringField(item.value))