From 455884932ea4a61b4f79c06fe8911cee6efa5f49 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 30 Jun 2022 14:56:11 +0200 Subject: [PATCH] fix(python): do not implicitly import PIL by trezorctl --- python/.changelog.d/noissue.fixed | 1 + python/src/trezorlib/debuglink.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 python/.changelog.d/noissue.fixed diff --git a/python/.changelog.d/noissue.fixed b/python/.changelog.d/noissue.fixed new file mode 100644 index 000000000..8ffbc3f5c --- /dev/null +++ b/python/.changelog.d/noissue.fixed @@ -0,0 +1 @@ +Fixed dependency error when running trezorctl without PIL. diff --git a/python/src/trezorlib/debuglink.py b/python/src/trezorlib/debuglink.py index f9fd54cf8..103205b50 100644 --- a/python/src/trezorlib/debuglink.py +++ b/python/src/trezorlib/debuglink.py @@ -38,7 +38,6 @@ from typing import ( ) from mnemonic import Mnemonic -from PIL import Image from . import mapping, messages, protobuf from .client import TrezorClient @@ -255,6 +254,8 @@ class DebugLink: self.save_screenshot_for_t1() def save_screenshot_for_t1(self) -> None: + from PIL import Image + layout = self.state().layout assert layout is not None assert len(layout) == 128 * 64 // 8