Bug #7935
openTypeError: '<=' not supported between instances of 'NoneType' and 'int'
0%
Description
When get_current_editorset() returns None, do_export() throws an exception comparing it to 0.
Files
Updated by Bernhard Hailer about 4 years ago
- Status changed from New to Feedback
Alex, did you submit this patch? If you haven't, please review the Wiki: Developers. Thanks!
Updated by Martin Cooper about 3 years ago
Your patch does not address the problem you describe. If get_current_editorset() returns None, then the code will die much earlier, on the line immediately after the call to that function, which attempts to dereference eset to get filename.
Your patch instead addresses the situation in which eset.do_export() returns None, and thus where 'count > 0' would effectively be 'None > 0'. Since do_export() will return None if it encounters an error, this is certainly valid. Interestingly, in early versions of Python (e.g. 2.6, 2.7) this comparison does not raise an exception, though in later versions it does.
The fix could also be effected by replacing 'count > 0' with 'count is not None and count > 0'.
Addendum: Looking a little more deeply, it seems that do_export() never returns a value. As such, this call to report_model_usage() will always be told that export failed. Very odd.