Skip to content

Commit 60fdcc2

Browse files
committed
Revert supress change
1 parent d453a5e commit 60fdcc2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

qrcode/image/pil.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import contextlib
2-
31
from PIL import Image, ImageDraw
42

53
import qrcode.image.base
@@ -19,11 +17,11 @@ def new_image(self, **kwargs):
1917
back_color = kwargs.get("back_color", "white")
2018
fill_color = kwargs.get("fill_color", "black")
2119

22-
with contextlib.suppress(AttributeError):
20+
try:
2321
fill_color = fill_color.lower()
24-
25-
with contextlib.suppress(AttributeError):
2622
back_color = back_color.lower()
23+
except AttributeError:
24+
pass
2725

2826
# L mode (1 mode) color = (r*299 + g*587 + b*114)//1000
2927
if fill_color == "black" and back_color == "white":

0 commit comments

Comments
 (0)