def shutdown(self): try: self.db.close() # No DB has been initialized except AttributeError: pass GBX2xmlrpc.shutdown(self)