Skip to content
Browse files

bugfix an error during python test (cannot compare None to int) & ign…

…ore compiled python files
  • Loading branch information...
1 parent 3dab0b5 commit 398c2173939084fb25178b14ad25bf797d1ac9d2 Jason Carver committed Nov 10, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 .gitignore
  2. +2 −2 py/ua_parser/user_agent_parser.py
View
2 .gitignore
@@ -3,4 +3,4 @@ node_modules
TAGS
dist
cabal-dev
-
+*.pyc
View
4 py/ua_parser/user_agent_parser.py
@@ -61,10 +61,10 @@ def Parse(self, user_agent_string):
if self.v1_replacement:
v1 = self.v1_replacement
- elif match.lastindex >= 2:
+ elif match.lastindex and match.lastindex >= 2:
v1 = match.group(2)
- if match.lastindex >= 3:
+ if match.lastindex and match.lastindex >= 3:
v2 = match.group(3)
if match.lastindex >= 4:
v3 = match.group(4)

0 comments on commit 398c217

Please sign in to comment.
Something went wrong with that request. Please try again.