We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d453a5e commit 60fdcc2Copy full SHA for 60fdcc2
qrcode/image/pil.py
@@ -1,5 +1,3 @@
1
-import contextlib
2
-
3
from PIL import Image, ImageDraw
4
5
import qrcode.image.base
@@ -19,11 +17,11 @@ def new_image(self, **kwargs):
19
17
back_color = kwargs.get("back_color", "white")
20
18
fill_color = kwargs.get("fill_color", "black")
21
22
- with contextlib.suppress(AttributeError):
+ try:
23
fill_color = fill_color.lower()
24
25
26
back_color = back_color.lower()
+ except AttributeError:
+ pass
27
28
# L mode (1 mode) color = (r*299 + g*587 + b*114)//1000
29
if fill_color == "black" and back_color == "white":
0 commit comments