For some reason a 404 response is sometimes returned as a JSON-like string and doesn't raise a HTTPError thereby avoiding the recursive search.
I have currently left the existing except block in assuming that this may also trigger depending on the search.
Also small update to the __get_location doc string to properly reflect the returned data.
To test
Ask for the "weather in Sydney Australia" or "weather in Johannesburg South Africa".
Without change - no response.
With change - recursively searches and returns location as Sydney and Johannesburg respectively.
For some reason a 404 response is sometimes returned as a JSON-like string and doesn't raise a HTTPError thereby avoiding the recursive search.
I have currently left the existing except block in assuming that this may also trigger depending on the search.
Also small update to the
__get_location
doc string to properly reflect the returned data.To test
Ask for the "weather in Sydney Australia" or "weather in Johannesburg South Africa". Without change - no response. With change - recursively searches and returns location as Sydney and Johannesburg respectively.