aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-08-02 13:22:02 -0700
committerZac Medico <zmedico@gentoo.org>2012-08-02 13:22:02 -0700
commitd9c77eec3c74c3b22b53911afaf2c167818fbc79 (patch)
tree2c55a88e25c5863b431824671330090ba7ff4d9d
parentparse_desktop_entry: fix python3 bug #429544 (diff)
downloadportage-d9c77eec3c74c3b22b53911afaf2c167818fbc79.tar.gz
portage-d9c77eec3c74c3b22b53911afaf2c167818fbc79.tar.bz2
portage-d9c77eec3c74c3b22b53911afaf2c167818fbc79.zip
vardbapi: optimize pickle load for Python >=3.2
-rw-r--r--pym/portage/dbapi/vartree.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 5008a97fb..1dadd3cbb 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -572,11 +572,12 @@ class vardbapi(dbapi):
def _aux_cache_init(self):
aux_cache = None
open_kwargs = {}
- if sys.hexversion >= 0x3000000:
+ if sys.hexversion >= 0x3000000 and sys.hexversion < 0x3020000:
# Buffered io triggers extreme performance issues in
# Unpickler.load() (problem observed with python-3.0.1).
# Unfortunately, performance is still poor relative to
- # python-2.x, but buffering makes it much worse.
+ # python-2.x, but buffering makes it much worse (problem
+ # appears to be solved in Python >=3.2 at least).
open_kwargs["buffering"] = 0
try:
f = open(_unicode_encode(self._aux_cache_filename,