mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Ask user to remove manually a file on exception
This commit is contained in:
@ -839,8 +839,10 @@ def rmtree_(path):
|
|||||||
os.remove(name)
|
os.remove(name)
|
||||||
except Exception as e: # pylint: disable=broad-except
|
except Exception as e: # pylint: disable=broad-except
|
||||||
click.secho(
|
click.secho(
|
||||||
"Please manually remove file `%s`" % name, fg="red", err=True)
|
"%s \n\nCould not remove the file `%s`. "
|
||||||
raise e
|
"Please remove it manually." % (str(e), name),
|
||||||
|
fg="red",
|
||||||
|
err=True)
|
||||||
|
|
||||||
return rmtree(path, onerror=_onerror)
|
return rmtree(path, onerror=_onerror)
|
||||||
|
|
||||||
@ -857,8 +859,7 @@ except ImportError:
|
|||||||
magic_check_bytes = re.compile(b'([*?[])')
|
magic_check_bytes = re.compile(b'([*?[])')
|
||||||
|
|
||||||
def glob_escape(pathname):
|
def glob_escape(pathname):
|
||||||
"""Escape all special characters.
|
"""Escape all special characters."""
|
||||||
"""
|
|
||||||
# Escaping is done by wrapping any of "*?[" between square brackets.
|
# Escaping is done by wrapping any of "*?[" between square brackets.
|
||||||
# Metacharacters do not work in the drive part and shouldn't be
|
# Metacharacters do not work in the drive part and shouldn't be
|
||||||
# escaped.
|
# escaped.
|
||||||
|
Reference in New Issue
Block a user