diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-20 10:57:44 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-09-20 10:57:44 +0000 |
commit | 7cb8fb941f09d1ac646be334745f90e16ebd46eb (patch) | |
tree | bad100ba3461c881ebd388d29a6ac859a8962a1a /pym/portage/cache/flat_hash.py | |
parent | e70e41916899163fb28a1f5fa24c0ee2b17707f7 (diff) | |
download | portage-7cb8fb941f09d1ac646be334745f90e16ebd46eb.tar.gz portage-7cb8fb941f09d1ac646be334745f90e16ebd46eb.tar.bz2 portage-7cb8fb941f09d1ac646be334745f90e16ebd46eb.zip |
Update syntax of 'except' statements for compatibility with Python 3.
(2to3-3.1 -f except -nw ${FILES})
svn path=/main/trunk/; revision=14289
Diffstat (limited to 'pym/portage/cache/flat_hash.py')
-rw-r--r-- | pym/portage/cache/flat_hash.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py index 259be4108..3f46df8b9 100644 --- a/pym/portage/cache/flat_hash.py +++ b/pym/portage/cache/flat_hash.py @@ -43,7 +43,7 @@ class database(fs_template.FsBased): return d finally: myf.close() - except (IOError, OSError), e: + except (IOError, OSError) as e: if e.errno != errno.ENOENT: raise cache_errors.CacheCorruption(cpv, e) raise KeyError(cpv) @@ -51,7 +51,7 @@ class database(fs_template.FsBased): def _parse_data(self, data, cpv): try: d = dict(map(lambda x:x.rstrip("\n").split("=", 1), data)) - except ValueError, e: + except ValueError as e: # If a line is missing an "=", the split length is 1 instead of 2. raise cache_errors.CacheCorruption(cpv, e) return d @@ -65,7 +65,7 @@ class database(fs_template.FsBased): encoding=_encodings['fs'], errors='strict'), mode='w', encoding=_encodings['repo.content'], errors='backslashreplace') - except (IOError, OSError), e: + except (IOError, OSError) as e: if errno.ENOENT == e.errno: try: self._ensure_dirs(cpv) @@ -73,7 +73,7 @@ class database(fs_template.FsBased): encoding=_encodings['fs'], errors='strict'), mode='w', encoding=_encodings['repo.content'], errors='backslashreplace') - except (OSError, IOError),e: + except (OSError, IOError) as e: raise cache_errors.CacheCorruption(cpv, e) else: raise cache_errors.CacheCorruption(cpv, e) @@ -93,7 +93,7 @@ class database(fs_template.FsBased): new_fp = os.path.join(self.location,cpv) try: os.rename(fp, new_fp) - except (OSError, IOError), e: + except (OSError, IOError) as e: os.remove(fp) raise cache_errors.CacheCorruption(cpv, e) @@ -102,7 +102,7 @@ class database(fs_template.FsBased): # import pdb;pdb.set_trace() try: os.remove(os.path.join(self.location,cpv)) - except OSError, e: + except OSError as e: if errno.ENOENT == e.errno: raise KeyError(cpv) else: @@ -120,7 +120,7 @@ class database(fs_template.FsBased): while len(dirs): try: dir_list = os.listdir(dirs[0]) - except OSError, e: + except OSError as e: if e.errno != errno.ENOENT: raise del e |