Permalink
Browse files

Merge pull request #86 from OpenInstall/py-test-bugfix

bugfix an error during python test (cannot compare None to int)
  • Loading branch information...
elsigh committed Nov 12, 2012
2 parents 2de1888 + 398c217 commit 312c8df2093a5f55856727839a3c296741383894
Showing with 3 additions and 3 deletions.
  1. +1 −1 .gitignore
  2. +2 −2 py/ua_parser/user_agent_parser.py
View
@@ -3,4 +3,4 @@ node_modules
TAGS
dist
cabal-dev
-
+*.pyc
@@ -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 312c8df

Please sign in to comment.