From: Arfrever Frehtes Taifersar Arahesis Date: Fri, 26 Jul 2013 08:22:47 +0000 (+0200) Subject: Fix NameError. X-Git-Tag: v2.2.0_alpha190~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7eaba631529148594b3136b9dcb55ae00c67e1be;p=portage.git Fix NameError. --- diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py index ad8648c69..40db0701e 100644 --- a/pym/portage/cache/sqlite.py +++ b/pym/portage/cache/sqlite.py @@ -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):