Changeset 3009

Show
Ignore:
Timestamp:
09/06/06 14:44:16 (18 years ago)
Author:
jerome
Message:

Now logs an error when the version of python-mysqldb lacks
some functionnalities (because it's too old).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/mysqlstorage.py

    r2954 r3009  
    4848        self.tool.logdebug("Trying to open database (host=%s, port=%s, dbname=%s, user=%s)..." % (host, port, dbname, user)) 
    4949        self.database = MySQLdb.connect(host=host, port=port, db=dbname, user=user, passwd=passwd) 
    50         self.database.autocommit(1) 
     50        try : 
     51            self.database.autocommit(1) 
     52        except AttributeError :     
     53            self.tool.printInfo(_("Your version of python-mysqldb is too old. Please install a newer release."), "error") 
    5154        self.cursor = self.database.cursor() 
    5255        self.cursor.execute("SET NAMES 'utf8';")