From e8a79c00fa616e23ec34a18a5de4d669223749c0 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Wed, 26 Jan 2022 06:48:35 -0500 Subject: [PATCH 1/2] modify ampy/files/py to import binascii if ubinascii not found --- ampy/files.py | 5 ++++- files.txt | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 files.txt diff --git a/ampy/files.py b/ampy/files.py index a0c574c..5cfaafa 100644 --- a/ampy/files.py +++ b/ampy/files.py @@ -59,7 +59,10 @@ def get(self, filename): # expects string data. command = """ import sys - import ubinascii + try: + import ubinascii + except: + import binascii as ubinascii with open('{0}', 'rb') as infile: while True: result = infile.read({1}) diff --git a/files.txt b/files.txt new file mode 100644 index 0000000..a2018b3 --- /dev/null +++ b/files.txt @@ -0,0 +1,3 @@ +/usr/local/bin/ampy +/usr/local/bin/dotenv +/usr/local/lib/python3.8/dist-packages/adafruit_ampy-1.1.0-py3.8.egg From fbcb490d09eb96991f52440e8f25ae5da8c46473 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Wed, 26 Jan 2022 06:49:21 -0500 Subject: [PATCH 2/2] remove extra file --- files.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 files.txt diff --git a/files.txt b/files.txt deleted file mode 100644 index a2018b3..0000000 --- a/files.txt +++ /dev/null @@ -1,3 +0,0 @@ -/usr/local/bin/ampy -/usr/local/bin/dotenv -/usr/local/lib/python3.8/dist-packages/adafruit_ampy-1.1.0-py3.8.egg