diff options
author | Erik Troan <ewt@redhat.com> | 2000-08-08 18:53:59 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2000-08-08 18:53:59 +0000 |
commit | ffd483c53fa77d5f2138ba527b3c3bdbecb09e05 (patch) | |
tree | 957bab69ea44c18bc1266af4d03ff8e0d8788496 /iutil.py | |
parent | 5fefde72bb02bacaa2cca99af2e64fad1e5358cf (diff) | |
download | anaconda-ffd483c53fa77d5f2138ba527b3c3bdbecb09e05.tar.gz anaconda-ffd483c53fa77d5f2138ba527b3c3bdbecb09e05.tar.xz anaconda-ffd483c53fa77d5f2138ba527b3c3bdbecb09e05.zip |
handle running out of space when copying stage2.img a bit more maturally
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -138,20 +138,22 @@ def copyFile(source, to, pw = None): total = os.path.getsize(source) win = fn(title, text, total) - count = os.read(f, 262144) - total = 0 - while (count): - os.write(t, count) - total = total + len(count) - if pw: - win.set(total) - count = os.read(f, 16384) - - os.close(f) - os.close(t) + try: + count = os.read(f, 262144) + total = 0 + while (count): + os.write(t, count) + + total = total + len(count) + if pw: + win.set(total) + count = os.read(f, 16384) + finally: + os.close(f) + os.close(t) - if pw: - win.pop() + if pw: + win.pop() def memInstalled(): f = open("/proc/meminfo", "r") |