Skip to content

Commit

Permalink
[checkcves.py] Fix AttributeError when checkcves is run with python 2
Browse files Browse the repository at this point in the history
JSONDecodeError is implemented in python 3.5+ due to which when the script finds invalid key or dashboard configs it throws ValueError instead of JSONDecodeError
  • Loading branch information
indresh.sharma committed Apr 9, 2024
1 parent 890bf89 commit c6dcff9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/checkcves.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def check_dashboard_config(conf_dashboard, default_dc_used):
if default_dc_used:
return
err_msg = "Dashboard config doesn't exists at %s." %conf_dashboard + err_suffix
except json.decoder.JSONDecodeError:
except ValueError:
err_msg = err_prefix + err_suffix
except Exception as e:
err_msg = "Unable to parse Dashboard config : %s." %e + err_suffix
Expand All @@ -308,7 +308,7 @@ def check_linuxlink_key(key, default_key_used):
if default_key_used:
return
err_msg = "Linuxlink key doesn't exists at %s." %key + err_suffix
except json.decoder.JSONDecodeError:
except ValueError:
err_msg = err_prefix + err_suffix
except Exception as e:
err_msg = "Unable to parse Linuxlink: %s." %e + err_suffix
Expand Down

0 comments on commit c6dcff9

Please sign in to comment.