[repo pyro] fix previous commit: should not import Pyro in remoterql module/base class, it may be missing
--- a/server/sources/pyrorql.py Mon Sep 03 12:26:20 2012 +0200
+++ b/server/sources/pyrorql.py Fri Sep 14 17:42:24 2012 +0200
@@ -91,5 +91,9 @@
except AttributeError:
# inmemory connection
pass
- return super(PyroRQLSource, self).check_connection(cnx)
+ try:
+ return super(PyroRQLSource, self).check_connection(cnx)
+ except ConnectionClosedError:
+ # try to reconnect
+ return self.get_connection()
--- a/server/sources/remoterql.py Mon Sep 03 12:26:20 2012 +0200
+++ b/server/sources/remoterql.py Fri Sep 14 17:42:24 2012 +0200
@@ -30,8 +30,6 @@
from rql.nodes import Constant
from rql.utils import rqlvar_maker
-from Pyro.errors import ConnectionClosedError
-
from cubicweb import dbapi, server
from cubicweb import ValidationError, BadConnectionId, UnknownEid
from cubicweb.schema import VIRTUAL_RTYPES
@@ -304,7 +302,7 @@
try:
cnx.check()
return # ok
- except (BadConnectionId, ConnectionClosedError):
+ except BadConnectionId:
pass
# try to reconnect
return self.get_connection()