Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 779d917

Browse files
author
Sergey Polischouck
committed
improve readability
1 parent 8b39b34 commit 779d917

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ua_parser/user_agent_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ def Parse(self, user_agent_string):
6161
if self.v1_replacement:
6262
v1 = self.v1_replacement
6363
elif match.lastindex and match.lastindex >= 2:
64-
v1 = match.group(2) if match.group(2) != '' else None
64+
v1 = match.group(2) or None
6565

6666
if self.v2_replacement:
6767
v2 = self.v2_replacement
6868
elif match.lastindex and match.lastindex >= 3:
69-
v2 = match.group(3) if match.group(3) != '' else None
69+
v2 = match.group(3) or None
7070

7171
if match.lastindex and match.lastindex >= 4:
72-
v3 = match.group(4) if match.group(4) != '' else None
72+
v3 = match.group(4) or None
7373

7474
return family, v1, v2, v3
7575

0 commit comments

Comments
 (0)