Commit 58084775 authored by Holger Niemann's avatar Holger Niemann
Browse files

small fix for the closing of connections in get_latest-version#

parent 7bdda71a
......@@ -45,6 +45,7 @@ except:
def get_latest_version(stream,project="W7X",Test=False,t_from=None,t_to=None,program=None):
"""Find out latest version of given stream
:param stream url stream of interest
:return int of version number of None if non-versioned or non-existing stream
......@@ -75,6 +76,8 @@ def get_latest_version(stream,project="W7X",Test=False,t_from=None,t_to=None,pro
except urllib.error.HTTPError as ex:
msg = ex.read()
raise RuntimeError(msg)
else:
response.close()
# detect unversioned or non-existing stream
if d["versionInfo"] == []:
return None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment