From 8d0d3df2b04b6b3d0786ce11cf7c1301407b6174 Mon Sep 17 00:00:00 2001
From: Simone Margaritelli <evilsocket@gmail.com>
Date: Sun, 20 Oct 2019 19:50:05 +0200
Subject: [PATCH] misc: small fix or general refactoring i did not bother
 commenting

---
 pwnagotchi/plugins/default/auto-update.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pwnagotchi/plugins/default/auto-update.py b/pwnagotchi/plugins/default/auto-update.py
index e78e67c..8e0ca32 100644
--- a/pwnagotchi/plugins/default/auto-update.py
+++ b/pwnagotchi/plugins/default/auto-update.py
@@ -88,7 +88,8 @@ def install(display, update):
     checksums = glob.glob("%s/*.sha256" % path)
     if len(checksums) == 0:
         if update['native']:
-            logging.warning("native update without SHA256 checksum file")
+            logging.warning("[update] native update without SHA256 checksum file")
+            return
 
     else:
         display.update(force=True, new_data={'status': 'Verifying %s ...' % name})
@@ -97,7 +98,7 @@ def install(display, update):
 
         logging.info("[update] verifying %s for %s ..." % (checksum, source_path))
 
-        with open(checksums) as fp:
+        with open(checksums, 'rt') as fp:
             expected = fp.read().strip().lower()
 
         real = subprocess.getoutput('sha256sum "%s"' % source_path).split(' ')[0].strip().lower()