This question already has an answer here:
In my code, there is a try except function, and im having issues with the except. The linter says 'do not use bare except'
Code in question is below.
val = val.strip()
try:
val = int(val.replace(',', ''))
metadata['num_'+tag] = val
except:
metadata[tag] = val
Any help to figure this out would be great. I am trying to get this to compile for python 3
Aucun commentaire:
Enregistrer un commentaire