core-image-minimal-initramfs: Remove odd quote characters

The quote characters present trigger python 3 characters type warnings,
we don't need them so replace them with normal quote characters.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
clases/lib: Use modern exception syntax

Update older code to use modern exception handling syntax which
is the form accepted by python 3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
buildstats: Update to ensure files are closed

python3 doesn't like files being left open. This updates the code style
to ensure file are closed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
classes: Use modern exception raising syntax

Modern expection rasing syntax is function call format, convert to this
to keep python 3 happy and model correct coding style in the core.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
classes/recipes/lib: Fix various python whitespace issues

There are some left over tab characters in the python functions. This
removes them and resolves python 3 errors.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
sanity.bbclass: Use open(), not file()

file() syntax is removed in python 3, use open() instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
metadata_scm: Replace deprecated operator

The <> operator is deprecated, use != instead which is equivalent.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
classes/lib: Update to use print as a function call

In python 3 print is a function call. In some cases bb.note is a more
appropriate call to make.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe: Replace StandardError with Exception

StandardError is removed in python3, replace with Exception class instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
insane: Open file in binary mode

We open the file we're writing to in binary mode so open the input stream with the
same mode so things match. This avoids errors with python3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
sanity/patch.py: Remove commands module usage

The commands module is removed in python3. Use the subprocess module instead
and the pipes module to replace the mkargs usage.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
image/kernel-module-split/eglibc-ld.inc: Remove has_key() usage

The has_key() attribute has been removed in python 3 since there is better
syntax available. Use the improved syntax.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base.bbclass: Drop unused/obsolete import

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake.conf: Use casting to ensure valid comparision

python3 is stricter about type comparisions so add an explicit cast to int()
to ensure this code is portable.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>