ich habe ein Problem mit try except finally
Ich bekomme in folgender Funktion
Code: Alles auswählen
def ShowAllCDs():
TextMatches.delete(1.0,"end")
oldcdnr = ""
data = Inidata(0)
mf.config(cursor="watch")
try:
fz = open(data.dbname)
dbfile = fz.readlines()
LabelState["text"] = "searching..."
for i in dbfile:
#cut characters before the first space char
cdnr = i.split(' ')[0]
if cdnr != oldcdnr:
TextMatches.insert("end",cdnr)
oldcdnr = cdnr
except IOError:#print gPath
tkMessageBox.showerror("File-Error", "Could not open file: " + data.dbname)
except:
tkMessageBox.showerror("Error", "Unexpected error when reading database" + data.dbname)
finally:
LabelState["text"] = "Ready"
mf.config(cursor="arrow")
File "<string>", line 98
finally:
^
SyntaxError: invalid syntax
Hat jemand eine Idee, an was das liegen kann.
Danke schonmal für eure Hilfe.
Alpha