From 2d4bc6997590724fe782f3ab8ab6b528dd78ed3b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 29 Aug 2017 00:31:44 +0300 Subject: [PATCH] sqlite3: Pass sys.byteorder to int.from_bytes(). Following it now being mandatory in MicroPython. --- sqlite3/sqlite3.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sqlite3/sqlite3.py b/sqlite3/sqlite3.py index bcd7c68b..de18a03e 100644 --- a/sqlite3/sqlite3.py +++ b/sqlite3/sqlite3.py @@ -1,3 +1,4 @@ +import sys import ffilib @@ -87,7 +88,7 @@ class Cursor: b = bytearray(4) s = sqlite3_prepare(self.h, sql, -1, b, None) check_error(self.h, s) - self.stmnt = int.from_bytes(b) + self.stmnt = int.from_bytes(b, sys.byteorder) #print("stmnt", self.stmnt) self.num_cols = sqlite3_column_count(self.stmnt) #print("num_cols", self.num_cols) @@ -130,7 +131,7 @@ class Cursor: def connect(fname): b = bytearray(4) sqlite3_open(fname, b) - h = int.from_bytes(b) + h = int.from_bytes(b, sys.byteorder) return Connections(h)