[ABRT PATCH 1/2] a-a-a-vmcore: save kernel version in 'kernel' file

Martin Milata mmilata at redhat.com
Wed May 29 15:22:52 UTC 2013


Pushed both, thanks!

On Mon, May 27, 2013 at 14:14:11 +0200, Jakub Filak wrote:
> +            # Please excuse the magic constant 9 => len('Version: '). This construction is more readable for me.
> +            if line[:9] == "Version: ":

I'd have used line.startswith("Version: ") ... but I'd say using the
same slicing syntax for getting the rest of the line justifies it.

> +                with open("kernel", "w") as kernel_file:
> +                    kernel_file.write(line[9:].rstrip())
> +                    ret = RETURN_OK # set OK only if it was successfully written


More information about the Crash-catcher mailing list