diff options
Diffstat (limited to 'pym/_emerge/__init__.py')
-rw-r--r-- | pym/_emerge/__init__.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index e52298f54..df6b3c80f 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -4027,9 +4027,8 @@ class BlockerCache(portage.cache.mappings.MutableMapping): def _load(self): try: - f = open(self._cache_filename) + f = open(self._cache_filename, mode='rb') mypickle = pickle.Unpickler(f) - mypickle.find_global = None self._cache_data = mypickle.load() f.close() del f @@ -4113,7 +4112,7 @@ class BlockerCache(portage.cache.mappings.MutableMapping): if len(self._modified) >= self._cache_threshold and \ secpass >= 2: try: - f = portage.util.atomic_ofstream(self._cache_filename) + f = portage.util.atomic_ofstream(self._cache_filename, mode='wb') pickle.dump(self._cache_data, f, -1) f.close() portage.util.apply_secpass_permissions( @@ -14069,14 +14068,7 @@ def action_build(settings, trees, mtimedb, # a list type for options. mtimedb["resume"]["myopts"] = myopts.copy() - # Convert Atom instances to plain str since the mtimedb loader - # sets unpickler.find_global = None which causes unpickler.load() - # to raise the following exception: - # - # cPickle.UnpicklingError: Global and instance pickles are not supported. - # - # TODO: Maybe stop setting find_global = None, or find some other - # way to avoid accidental triggering of the above UnpicklingError. + # Convert Atom instances to plain str. mtimedb["resume"]["favorites"] = [str(x) for x in favorites] if ("--digest" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): |