Closed hroncok closed 7 years ago
The only thing that prevent's 3.4 to run this is the missing json.JSONDecodeError exception:
json.JSONDecodeError
https://github.com/meadowfrey/OctoPrint-Dashboard/blob/8e96cdd026e16a9251b24c1fb62487192d1b0ed7/octoprint_dashboard/services/octoprintService.py#L1
In order to make this 3.4 compatible (as 3.4 runs in FIT CTU classrooms), you should probably send a PR to octoclient not to leak this exception, but as a workaround, you can try to get ValueError instead (raised by 3.4:
ValueError
try: from json import JSONDecodeError except ImportError: # Python 3.4 JSONDecodeError = ValueError
Or (even better) catch ValueError here instead of json.JSONDecodeError (this works thanks to class inheritance).
>>> from json import JSONDecodeError >>> JSONDecodeError.__base__ <class 'ValueError'>
fixed with commit 9d2ff2a5a2daa0b62121d253779515f6b7d647e4
The only thing that prevent's 3.4 to run this is the missing
json.JSONDecodeError
exception:https://github.com/meadowfrey/OctoPrint-Dashboard/blob/8e96cdd026e16a9251b24c1fb62487192d1b0ed7/octoprint_dashboard/services/octoprintService.py#L1
In order to make this 3.4 compatible (as 3.4 runs in FIT CTU classrooms), you should probably send a PR to octoclient not to leak this exception, but as a workaround, you can try to get
ValueError
instead (raised by 3.4:Or (even better) catch
ValueError
here instead ofjson.JSONDecodeError
(this works thanks to class inheritance).