Skip to content

Commit

Permalink
short circuit friendly flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattwmaster58 committed Jul 14, 2018
1 parent 0649fcc commit ed046d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytube/query.py
Expand Up @@ -171,7 +171,7 @@ def order_by(self, attribute_name):
integer_attr_repr[attr] = int(''.join(num)) if num else None

# if every attribute has an integer representation
if all(integer_attr_repr.values()) and integer_attr_repr:
if integer_attr_repr and all(integer_attr_repr.values()):
def key(s): return integer_attr_repr[getattr(s, attribute_name)]
else:
def key(s): return getattr(s, attribute_name)
Expand Down

0 comments on commit ed046d8

Please sign in to comment.