Skip to content

Commit

Permalink
gdaltest.gdalurlopen(): better detect timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 16, 2023
1 parent 54e4eef commit b2015f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autotest/pymod/gdaltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,10 @@ def gdalurlopen(url, timeout=10):
print(f"HTTP service for {url} is down (URL Error: {e.reason})")
socket.setdefaulttimeout(old_timeout)
return None
except socket.timeout:
print(f"HTTP service for {url} timed out")
socket.setdefaulttimeout(old_timeout)
return None


def runexternal(
Expand Down

0 comments on commit b2015f8

Please sign in to comment.