Fehler beim Löschen werden abgefangen
This commit is contained in:
parent
a8a3bdc028
commit
96ef315eee
1 changed files with 5 additions and 2 deletions
|
|
@ -462,8 +462,11 @@ def zufName(geschlecht):
|
||||||
return random.choice(data["Mann"])
|
return random.choice(data["Mann"])
|
||||||
def delete(pfad_ogg):
|
def delete(pfad_ogg):
|
||||||
if pfad_ogg.exists():
|
if pfad_ogg.exists():
|
||||||
|
try:
|
||||||
pfad_ogg.unlink()
|
pfad_ogg.unlink()
|
||||||
logging.info("Datei gelöscht: %s", pfad_ogg)
|
logging.info("Datei gelöscht: %s", pfad_ogg)
|
||||||
|
except:
|
||||||
|
logging.info("Datei gerade in Benutzung: %s", pfad_ogg)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
host = os.getcwd()
|
host = os.getcwd()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue