def delete(self):
        dir = os.path.dirname(os.path.join(settings.MEDIA_ROOT, self.fileobject.name))
        try: self.fileobject.delete()
        except __HOLE__: pass
        try: os.rmdir(dir)
        except OSError: pass
        return Model.delete(self)
dataset/ETHPy150Open peterkuma/fileshackproject/fileshack/models.py/Item.delete