aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/python/pg.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/python/pg.py')
-rw-r--r--src/interfaces/python/pg.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/interfaces/python/pg.py b/src/interfaces/python/pg.py
index df502397fa6..0e40a6e5a47 100644
--- a/src/interfaces/python/pg.py
+++ b/src/interfaces/python/pg.py
@@ -48,14 +48,10 @@ class DB:
def __init__(self, *args, **kw):
self.db = apply(connect, args, kw)
- # Create convience methods, in a way that is still overridable.
- for e in ( 'query', 'reset', 'close', 'getnotify', 'inserttable',
- 'putline', 'getline', 'endcopy',
- 'host', 'port', 'db', 'options',
- 'tty', 'error', 'status', 'user',
- 'locreate', 'getlo', 'loimport' ):
- if not hasattr(self,e) and hasattr(self.db,e):
- exec 'self.%s = self.db.%s' % ( e, e )
+ # Create convience methods, in a way that is still overridable
+ # (members are not copied because they are actually functions)
+ for e in self.db.__methods__:
+ setattr(self, e, getattr(self.db, e))
self.__attnames__ = {}
self.__pkeys__ = {}