From 50f6a9a03e4e75a33586fe41e704c61ca981dbc2 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 19 Feb 2009 11:48:09 +0000 Subject: [PATCH] Tweak exception handling indentation to avoid a bug in 2to3. svn path=/main/trunk/; revision=12646 --- 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