summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-07-27 19:11:21 +0000
committerZac Medico <zmedico@gentoo.org>2006-07-27 19:11:21 +0000
commitd427118eb3a19a002b1889b7ed634c3eb877c2b5 (patch)
tree143f368f8bac856ebcd1858a804d6a3acb1aaca3
parent6d4cf62440f60b2e41a9e8e824b876093f6517c3 (diff)
downloadportage-d427118eb3a19a002b1889b7ed634c3eb877c2b5.tar.gz
portage-d427118eb3a19a002b1889b7ed634c3eb877c2b5.tar.bz2
portage-d427118eb3a19a002b1889b7ed634c3eb877c2b5.zip
Fix ENOENT exception handler so that it only wraps the relevant stat call.
svn path=/main/trunk/; revision=4032
-rw-r--r--pym/portage.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 19bd65a51..4cb3716e0 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2067,7 +2067,13 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
if mydigests!=None and mydigests.has_key(myfile):
try:
- mystat=os.stat(mysettings["DISTDIR"]+"/"+myfile)
+ mystat = os.stat(myfile_path)
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+ fetched = 0
+ else:
# no exception? file exists. let digestcheck() report
# an appropriately for size or checksum errors
if (mystat[stat.ST_SIZE]<mydigests[myfile]["size"]):
@@ -2116,13 +2122,6 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
eout.eend(0)
fetched=2
break
- except (OSError,IOError),e:
- # ENOENT is expected from the stat call at the
- # beginning of this try block.
- if e.errno != errno.ENOENT:
- writemsg("An exception was caught(2)...\nFailing the download: %s.\n" % (str(e)),
- noiselevel=-1)
- fetched=0
else:
if not myret:
fetched=2