Fix NameError.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Fri, 26 Jul 2013 08:22:47 +0000 (10:22 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Fri, 26 Jul 2013 08:22:47 +0000 (10:22 +0200)
pym/portage/cache/sqlite.py

index ad8648c6972873eb0ca1a22b331c52b02be28735..40db0701e35565f8f248a6b06f2a8c07fea02bc2 100644 (file)
@@ -40,8 +40,8 @@ class database(fs_template.FsBased):
                config.setdefault("autocommit", self.autocommits)
                config.setdefault("cache_bytes", self.cache_bytes)
                config.setdefault("synchronous", self.synchronous)
-               # Timeout for throwing a "database is locked" exception (pysqlite
-               # default is 5.0 seconds).
+               # Set longer timeout for throwing a "database is locked" exception.
+               # Default timeout in sqlite3 module is 5.0 seconds.
                config.setdefault("timeout", 15)
                self._db_init_connection(config)
                self._db_init_structures()
@@ -50,7 +50,7 @@ class database(fs_template.FsBased):
                # sqlite3 is optional with >=python-2.5
                try:
                        import sqlite3 as db_module
-               except ImportError:
+               except ImportError as e:
                        raise cache_errors.InitializationError(self.__class__, e)
 
                self._db_module = db_module
@@ -62,7 +62,6 @@ class database(fs_template.FsBased):
                        # Avoid potential UnicodeEncodeError in python-2.x by
                        # only calling str() when it's absolutely necessary.
                        s = str(s)
-               # This is equivalent to the _quote function from pysqlite 1.1.
                return "'%s'" % s.replace("'", "''")
 
        def _db_init_connection(self, config):