Ideally, the following line is enough to avoid error from empty response. https://github.com/lukasschwab/arxiv.py/blob/e2f4ee4d2357331825c93dfe6b2f7110044637d2/arxiv/arxiv.py#L38
But there are some special cases, say id_list=["1912.08031"], the results array is not empty but with one element of no meaning. This will cause error in mod_query_result function.
Therefore, I added one line code to check this behavior avoiding unnecessary errors and make sure the return value results is an empty list when there are no matching items.
Ideally, the following line is enough to avoid error from empty response. https://github.com/lukasschwab/arxiv.py/blob/e2f4ee4d2357331825c93dfe6b2f7110044637d2/arxiv/arxiv.py#L38 But there are some special cases, say
id_list=["1912.08031"]
, theresults
array is not empty but with one element of no meaning. This will cause error inmod_query_result
function. Therefore, I added one line code to check this behavior avoiding unnecessary errors and make sure the return valueresults
is an empty list when there are no matching items.