diff options
-rw-r--r-- | pym/_emerge/__init__.py | 5 | ||||
-rw-r--r-- | pym/portage/__init__.py | 5 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 5 | ||||
-rw-r--r-- | pym/portage/getbinpkg.py | 8 |
4 files changed, 22 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 8abe080f9..a53d58a8f 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -4105,6 +4105,11 @@ class BlockerCache(portage.cache.mappings.MutableMapping): try: f = open(self._cache_filename, mode='rb') mypickle = pickle.Unpickler(f) + try: + mypickle.find_global = None + except AttributeError: + # TODO: If py3k, override Unpickler.find_class(). + pass self._cache_data = mypickle.load() f.close() del f diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index b9365ff36..26860de80 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -7819,6 +7819,11 @@ class MtimeDB(dict): try: f = open(filename, 'rb') mypickle = pickle.Unpickler(f) + try: + mypickle.find_global = None + except AttributeError: + # TODO: If py3k, override Unpickler.find_class(). + pass d = mypickle.load() f.close() del f diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 7509f06f5..63705d27c 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1059,6 +1059,11 @@ class vardbapi(dbapi): try: f = open(self._aux_cache_filename, mode='rb', **open_kwargs) mypickle = pickle.Unpickler(f) + try: + mypickle.find_global = None + except AttributeError: + # TODO: If py3k, override Unpickler.find_class(). + pass aux_cache = mypickle.load() f.close() del f diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py index bb3911a6b..02e5de277 100644 --- a/pym/portage/getbinpkg.py +++ b/pym/portage/getbinpkg.py @@ -486,7 +486,13 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache= out = sys.stdout try: metadatafile = open(metadatafilename, 'rb') - metadata = pickle.load(metadatafile) + mypickle = pickle.Unpickler(metadatafile) + try: + mypickle.find_global = None + except AttributeError: + # TODO: If py3k, override Unpickler.find_class(). + pass + metadata = mypickle.load() out.write("Loaded metadata pickle.\n") out.flush() metadatafile.close() |