From 49b704864c7db49e41a0b6bbdb8a2840e7fa232b Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Fri, 16 Jun 2017 16:19:29 +0300 Subject: wic: code cleanup Split long lines. Removed unused imports. Signed-off-by: Ed Bartosh Signed-off-by: Ross Burton --- scripts/lib/wic/filemap.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'scripts/lib/wic/filemap.py') 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): Returns block size for file object 'file_obj'. Errors are indicated by the 'IOError' exception. """ - - from fcntl import ioctl - import struct - # Get the block size of the host file-system for the image file by calling # the FIGETBSZ ioctl (number 2). - binary_data = ioctl(file_obj, 2, struct.pack('I', 0)) + binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0)) return struct.unpack('I', binary_data)[0] class ErrorNotSupp(Exception): @@ -228,7 +224,7 @@ class FilemapSeek(_FilemapBase): try: tmp_obj = tempfile.TemporaryFile("w+", dir=directory) except IOError as err: - raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" + raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" \ % (directory, err)) try: -- cgit v1.2.3