mirror of
https://github.com/chubin/wttr.in.git
synced 2024-10-05 01:42:07 +02:00
Merge pull request #869 from jdutchik/339_bug_fix
339 Bug Fix for Invalid Domain Name
This commit is contained in:
commit
9c2de2801b
@ -406,12 +406,17 @@ def location_processing(location, ip_addr):
|
|||||||
|
|
||||||
if location and location.lstrip('~ ').startswith('@'):
|
if location and location.lstrip('~ ').startswith('@'):
|
||||||
try:
|
try:
|
||||||
location, region, country = _get_location(
|
if (location.lstrip('~ ')[1:] == ""):
|
||||||
socket.gethostbyname(
|
location, region, country = NOT_FOUND_LOCATION, None, None
|
||||||
location.lstrip('~ ')[1:]))
|
|
||||||
location = '~' + location
|
else:
|
||||||
location = _fully_qualified_location(location, region, country)
|
location, region, country = _get_location(
|
||||||
hide_full_address = not force_show_full_address
|
socket.gethostbyname(
|
||||||
|
location.lstrip('~ ')[1:]))
|
||||||
|
location = '~' + location
|
||||||
|
location = _fully_qualified_location(location, region, country)
|
||||||
|
hide_full_address = not force_show_full_address
|
||||||
|
|
||||||
except:
|
except:
|
||||||
location, region, country = NOT_FOUND_LOCATION, None, None
|
location, region, country = NOT_FOUND_LOCATION, None, None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user