Skip to content

Commit cc424ae

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2dd2013 commit cc424ae

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

qtpy/_utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def add_action(self, *args, old_add_action):
8383
member: bytes
8484

8585
# if args and isinstance(args[0], QIcon):
86-
if any(map(lambda arg: isinstance(arg, QIcon), args[:1])): # Better to use previous line instead of this
86+
if any(
87+
isinstance(arg, QIcon) for arg in args[:1]
88+
): # Better to use previous line instead of this
8789
icon, *args = args
8890
else:
8991
icon = QIcon()
@@ -99,12 +101,11 @@ def add_action(self, *args, old_add_action):
99101
bytes,
100102
],
101103
)
102-
):
103-
if len(args) >= 2:
104-
text, shortcut, *args = args
105-
action = old_add_action(self, icon, text, *args)
106-
action.setShortcut(shortcut)
107-
return action
104+
) and len(args) >= 2:
105+
text, shortcut, *args = args
106+
action = old_add_action(self, icon, text, *args)
107+
action.setShortcut(shortcut)
108+
return action
108109

109110
return old_add_action(self, *args)
110111

0 commit comments

Comments
 (0)