update_payload: Fix array type in applier.py

In python3, the array type 'c' is no longer supported. Type 'c' arrays
are replaced by type 'b'(signed char) and 'B'(unsigned char). 'B' is
supported by python 2 and python3.
Replaced deprecate function 'buffer' by memoryview in python3.

BUG=chromium:1027199
TEST=unittest, cros_generate_update_payload, tryjob

Change-Id: Id77ba2d1aac0005d31516da4e6ac4617027ca345
Exempt-From-Owner-Approval: -release builders are on fire
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1932226
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/update_payload/applier.py b/scripts/update_payload/applier.py
index 7830c00..7eaa07a 100644
--- a/scripts/update_payload/applier.py
+++ b/scripts/update_payload/applier.py
@@ -52,7 +52,9 @@
 from update_payload import common
 from update_payload.error import PayloadError
 
-
+# buffer is not supported in python3, but memoryview has the same functionality
+if sys.version_info.major >= 3:
+  buffer = memoryview  # pylint: disable=invalid-name, redefined-builtin
 #
 # Helper functions.
 #
@@ -107,7 +109,7 @@
   Returns:
     A character array containing the concatenated read data.
   """
-  data = array.array('c')
+  data = array.array('B')
   if max_length < 0:
     max_length = sys.maxsize
   for ex in extents: