~novalkar/gwibber/google-reader

« back to all changes in this revision

Viewing changes to gwibber/gwui.py

  • Committer: Dominic Evans
  • Date: 2009-02-10 17:06:32 UTC
  • Revision ID: oldmanuk@gmail.com-20090210170632-ypl97jc1nawehnrv
Make _sure_ we do not write 0 byte avatar images on 404 errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
        print 'image_cache HTTP Error %s: %s whilst fetching %s' % (e.code, e.msg, e.url)
125
125
      else:
126
126
        print e
127
 
 
128
 
  # if there were any problems getting the avatar img and it still doesn't
129
 
  # exist then return None
130
 
  if not os.path.exists(img_path):
131
 
    return None
 
127
      # if there were any problems getting the avatar img and it still doesn't then return None
 
128
      os.remove(img_path)
 
129
      return None
132
130
 
133
131
  return img_path