Move delete function to util.py

This makes it easier to reuse in other places.
This commit is contained in:
Aneesh Agrawal 2017-04-16 16:01:54 -04:00
parent 7413c716fb
commit b1824f7a05
2 changed files with 14 additions and 12 deletions

View file

@ -33,13 +33,7 @@ from servo.command_base import (
is_windows,
get_browserhtml_path,
)
def delete(path):
try:
os.remove(path) # Succeeds if path was a file
except OSError: # Or, if path was a directory...
shutil.rmtree(path) # Remove it and all its contents.
from servo.util import delete
def otool(s):