Exception Handling
Verfasst: Mittwoch 23. Mai 2012, 11:46
Hallo!
Was mache ich wenn mir das Exception-Handling "zu grob" ist?
Beispiel:
Kann ich das except-statement noch "feiner" angeben? (Hab schon nach "Errno" etc. gegoogelt aber leider nichts passendes gefunden.
Vielen Dank!
Was mache ich wenn mir das Exception-Handling "zu grob" ist?
Beispiel:
Code: Alles auswählen
try:
os.symlink("mypath", "mylink")
except OSError: #hier würde ich gerne nur einen bestimmten Fehler abfangen: Errno 17 File Exists
"handle exception"
Vielen Dank!