Skip to content

Commit 483e72a

Browse files
committed
rename argument
1 parent c53d47b commit 483e72a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

adafruit_imageload/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad.git"
1818

1919

20-
def load(filename, *, bitmap=None, palette=None):
20+
def load(file_or_filename, *, bitmap=None, palette=None):
2121
"""Load pixel values (indices or colors) into a bitmap and colors into a palette.
2222
2323
bitmap is the desired type. It must take width, height and color_depth in the constructor. It
@@ -39,11 +39,12 @@ def load(filename, *, bitmap=None, palette=None):
3939
# meh, we tried
4040
pass
4141

42-
file_or_filename = filename
4342
if isinstance(file_or_filename, str):
44-
file_or_filename = open(filename, "rb")
43+
open_file = open(file_or_filename, "rb")
44+
else:
45+
open_file = file_or_filename
4546

46-
with file_or_filename as file:
47+
with open_file as file:
4748
header = file.read(3)
4849
file.seek(0)
4950
if header.startswith(b"BM"):

0 commit comments

Comments
 (0)