mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
print details on error msg (e.g. PermissionError on specific file)
This commit is contained in:
parent
894b8e7ff6
commit
ff233d5743
|
@ -132,7 +132,7 @@ class Warnings(object):
|
|||
"are currently: da, de, el, en, id, lb, pt, ru, sr, ta, th.")
|
||||
|
||||
# TODO: fix numbering after merging develop into master
|
||||
W091 = ("Could not clean/remove the temp directory at {dir}.")
|
||||
W091 = ("Could not clean/remove the temp directory at {dir}: {msg}.")
|
||||
W092 = ("Ignoring annotations for sentence starts, as dependency heads are set.")
|
||||
W093 = ("Could not find any data to train the {name} on. Is your "
|
||||
"input data correctly formatted ?")
|
||||
|
|
|
@ -469,8 +469,8 @@ def make_tempdir():
|
|||
yield d
|
||||
try:
|
||||
shutil.rmtree(str(d))
|
||||
except PermissionError:
|
||||
warnings.warn(Warnings.W091.format(dir=d))
|
||||
except PermissionError as e:
|
||||
warnings.warn(Warnings.W091.format(dir=d, msg=e))
|
||||
|
||||
|
||||
def get_hash(data) -> str:
|
||||
|
|
Loading…
Reference in New Issue
Block a user