It looks like I haven't quite mastered the handling of Exception yet. I am at a loss :( The following code sometimes returns this error:
File "applications/pingback/modules/plugin_h_pingback.py", line 190, in ping db(table.id==id_).update(status=status) UnboundLocalError: local variable 'status' referenced before assignment
I expect that status will always be assigned a value. Could another exception be made (perhaps in an internal try ), and finally hide it?
... try: server_url = self._get_pingback_server(target) except PingbackClientError, e: status = e.message else: try: server = xmlrpclib.ServerProxy(server_url) status = server.pingback.ping(self.source, target) except xmlrpclib.Fault, e: status = e finally: db(table.id==id_).update(status=status)
Thanks HC
source share