diff -burN mysql-connector-python-0.1.5-devel/mysql/connector/mysql.py mysql-connector-python-0.1.5-devel.mod/mysql/connector/mysql.py --- mysql-connector-python-0.1.5-devel/mysql/connector/mysql.py 2010-05-27 11:27:53.000000000 +0200 +++ mysql-connector-python-0.1.5-devel.mod/mysql/connector/mysql.py 2010-07-30 16:21:54.000000000 +0200 @@ -189,8 +189,12 @@ """ Set the username and/or password for the user connecting to the MySQL Server. """ - self.username = username.strip() if username else '' - self.password = password.strip() if password else '' + self.username = username.strip() + if not username: + self.username = '' + self.password = password.strip() + if not password: + self.password = '' def set_unicode(self, value=True): """ @@ -205,7 +209,9 @@ """ Set the database to be used after connection succeeded. """ - self.database = database.strip() if database else '' + self.database = database.strip() + if not database: + self.database = '' def set_charset_info(self, info=None, charset=None): @@ -258,7 +264,9 @@ Set auto commit on or off. """ try: - s = 'ON' if switch else 'OFF' + s = 'ON' + if not switch: + s = 'OFF' self._execute_query("SET AUTOCOMMIT = %s" % s) except: raise diff -burN mysql-connector-python-0.1.5-devel/mysql/connector/protocol.py mysql-connector-python-0.1.5-devel.mod/mysql/connector/protocol.py --- mysql-connector-python-0.1.5-devel/mysql/connector/protocol.py 2010-05-27 11:27:53.000000000 +0200 +++ mysql-connector-python-0.1.5-devel.mod/mysql/connector/protocol.py 2010-07-30 16:23:03.000000000 +0200 @@ -357,7 +357,11 @@ "http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html") try: - with_db = True if client_flags & ClientFlag.CONNECT_WITH_DB else False + with_db = True + if client_flags & ClientFlag.CONNECT_WITH_DB: + with_db = True + else: + with_db = False if not with_db and database: self.cmd_init_db(database) except: