check file exist for removing

This commit is contained in:
Volkan Şahin 2016-09-21 11:46:46 +03:00
parent 1c0f5206fa
commit a3374ebe65

View file

@ -2,15 +2,15 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com> # Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
import datetime
import grp import grp
import hashlib
import json import json
import os import os
import pwd import pwd
import shutil import shutil
import stat import stat
import subprocess import subprocess
import hashlib
import datetime
import uuid import uuid
@ -44,7 +44,8 @@ class Util:
@staticmethod @staticmethod
def delete_file(full_path): def delete_file(full_path):
try: try:
os.remove(full_path) if Util.is_exist(full_path):
os.remove(full_path)
except: except:
raise raise