Commit 60b02a34 authored by Pfeiffer, Götz's avatar Pfeiffer, Götz
Browse files

iddb: Compatibility with python 3.2 was ensured.


On our host "elbe" python 3 is quite old, this caused "iddb" to fail since the
names of exceptions in module http.client are differnt in newer python
versions.
parent 372b68e7
......@@ -21,6 +21,13 @@ import importlib
# -----------------------------------------------
# global variables
_pyver= (sys.version_info[0], sys.version_info[1])
if _pyver <= (3,2):
HTTPEXCEPTION= http.client.HTTPException
else:
HTTPEXCEPTION= http.client.RemoteDisconnected
DBNAME="id_db"
HOST="gwc2c.acc.bessy.de"
PORT=7643
......@@ -113,7 +120,7 @@ class DbXML:
"""execute StructuredData "get" command."""
try:
return self.XML_OBJ.fun.get(pattern,False,paths,DBNAME)
except (http.client.RemoteDisconnected,
except (HTTPEXCEPTION,
socket.gaierror, socket.timeout) as e:
sys.exit(self.errmsg(str(e)))
except xmlrpc.client.Fault as e:
......
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