summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-08-08 18:53:59 +0000
committerErik Troan <ewt@redhat.com>2000-08-08 18:53:59 +0000
commitffd483c53fa77d5f2138ba527b3c3bdbecb09e05 (patch)
tree957bab69ea44c18bc1266af4d03ff8e0d8788496 /iutil.py
parent5fefde72bb02bacaa2cca99af2e64fad1e5358cf (diff)
downloadanaconda-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.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/iutil.py b/iutil.py
index 7dbd47841..1f7602d57 100644
--- a/iutil.py
+++ b/iutil.py
@@ -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")