diff options
Diffstat (limited to 'scripts/lib/wic/filemap.py')
-rw-r--r-- | scripts/lib/wic/filemap.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py index 6d11355a18..77e32b9add 100644 --- a/scripts/lib/wic/filemap.py +++ b/scripts/lib/wic/filemap.py | |||
@@ -34,13 +34,9 @@ def get_block_size(file_obj): | |||
34 | Returns block size for file object 'file_obj'. Errors are indicated by the | 34 | Returns block size for file object 'file_obj'. Errors are indicated by the |
35 | 'IOError' exception. | 35 | 'IOError' exception. |
36 | """ | 36 | """ |
37 | |||
38 | from fcntl import ioctl | ||
39 | import struct | ||
40 | |||
41 | # Get the block size of the host file-system for the image file by calling | 37 | # Get the block size of the host file-system for the image file by calling |
42 | # the FIGETBSZ ioctl (number 2). | 38 | # the FIGETBSZ ioctl (number 2). |
43 | binary_data = ioctl(file_obj, 2, struct.pack('I', 0)) | 39 | binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0)) |
44 | return struct.unpack('I', binary_data)[0] | 40 | return struct.unpack('I', binary_data)[0] |
45 | 41 | ||
46 | class ErrorNotSupp(Exception): | 42 | class ErrorNotSupp(Exception): |
@@ -228,7 +224,7 @@ class FilemapSeek(_FilemapBase): | |||
228 | try: | 224 | try: |
229 | tmp_obj = tempfile.TemporaryFile("w+", dir=directory) | 225 | tmp_obj = tempfile.TemporaryFile("w+", dir=directory) |
230 | except IOError as err: | 226 | except IOError as err: |
231 | raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" | 227 | raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" \ |
232 | % (directory, err)) | 228 | % (directory, err)) |
233 | 229 | ||
234 | try: | 230 | try: |