vendredi 25 mai 2018

Im modifying a python scraper, and having issues with an except [duplicate]

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