@receiver(post_delete)
def delete_file(sender, instance, **kwargs):
    if sender == SourceFile or sender == ResourceVariant:
        if settings.AWS_ENABLED:
            try:
                s3.delete_file('source', instance.s3_path)
            except:
                traceback.print_exc()
        else:
            try:
                os.unlink(instance.local_filename)
            except __HOLE__:
                pass
dataset/ETHPy150Open pebble/cloudpebble/ide/models/files.py/delete_file