From 7825748a268683a3afeef06b57a7f9b70e41c410 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 29 Dec 2012 02:21:47 +0100 Subject: Use psycopg2 PgSQL module --- modules/pgsql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/pgsql.py b/modules/pgsql.py index 24cec76..a09a6de 100644 --- a/modules/pgsql.py +++ b/modules/pgsql.py @@ -1,5 +1,5 @@ from . import ModuleBase -from pyPgSQL import PgSQL +import psycopg2 class Module(ModuleBase): def __init__(self, manager): @@ -17,12 +17,12 @@ class Module(ModuleBase): except: pass - self.db = PgSQL.connect(host = self.conf['host'], user = self.conf['user'], password = self.conf['passwd'], database = self.conf['db'], client_encoding = 'utf8', unicode_results = 1) + self.db = psycopg2.connect(host = self.conf['host'], user = self.conf['user'], password = self.conf['passwd'], database = self.conf['db']) def cursor(self): try: return self.db.cursor() - except PgSQL.OperationalError: + except psycopg2.OperationalError: self._connect() return self.db.cursor() -- cgit v1.2.3