From 74e4618d558a7d06522ea2e941b1812f864c4a7a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 11 Mar 2009 05:55:18 +0000 Subject: [PATCH] Tweak exception handling indentation to avoid a bug in 2to3. (trunk r12646) svn path=/main/branches/2.1.6/; revision=12917 --- pym/portage/cache/flat_hash.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py index b9781b0c7..dda380e1c 100644 --- a/pym/portage/cache/flat_hash.py +++ b/pym/portage/cache/flat_hash.py @@ -65,7 +65,8 @@ class database(fs_template.FsBased): # import pdb;pdb.set_trace() s = cpv.rfind("/") fp = os.path.join(self.location,cpv[:s],".update.%i.%s" % (os.getpid(), cpv[s+1:])) - try: myf=open(fp, "w") + try: + myf = open(fp, 'w') except (IOError, OSError), e: if errno.ENOENT == e.errno: try: @@ -89,7 +90,8 @@ class database(fs_template.FsBased): #update written. now we move it. new_fp = os.path.join(self.location,cpv) - try: os.rename(fp, new_fp) + try: + os.rename(fp, new_fp) except (OSError, IOError), e: os.remove(fp) raise cache_errors.CacheCorruption(cpv, e) -- 2.26.2