added smart_rmtree utility function
This commit is contained in:
parent
a445956ed5
commit
6db55b5a8e
1 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,7 @@ from .constants import tmp_dir
|
|||
from importlib.machinery import SourceFileLoader
|
||||
from os import system, makedirs
|
||||
from os.path import dirname
|
||||
from shutil import rmtree
|
||||
import zipfile
|
||||
|
||||
|
||||
|
@ -44,6 +45,13 @@ def smart_mkdir(path: str):
|
|||
pass
|
||||
|
||||
|
||||
def smart_rmtree(path):
|
||||
try:
|
||||
rmtree(path)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def copy_file(src: str, dst: str, mode="644"):
|
||||
"""
|
||||
Copies src to dst.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue