File indexing completed on 2026-04-10 08:39:07
0001
0002 class WrappedPostgresConn(object):
0003 def __init__(self, conn):
0004 self.orig_conn = conn
0005
0006 def __getattribute__(self, item):
0007 try:
0008 return object.__getattribute__(self.orig_conn, item)
0009 except Exception:
0010 pass
0011 return object.__getattribute__(self, item)
0012
0013 def begin(self):
0014 pass
0015
0016 def ping(self):
0017 if self.orig_conn.closed:
0018 raise RuntimeError("connection closed")
0019
0020 def __enter__(self):
0021 return self.orig_conn.__enter__()
0022
0023 def __exit__(self, exc_type, exc_val, exc_tb):
0024 self.orig_conn.__exit__(exc_type, exc_val, exc_tb)