Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5 from coledarr/xml_error_fix

Some errors don't have line or column, return None
  • Loading branch information...
commit 7ed86d6feebc851a91f53d9c3a923d12dc98d764 2 parents e0423e9 + e008479
@actionshrimp authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 xpath/xpath.py
View
7 xpath/xpath.py 100644 → 100755
@@ -439,8 +439,11 @@ def set_error_position(self, error):
def first_group_match(self, pattern, text):
search = re.search(pattern, text)
- groups = search.groups()
- return groups[0]
+ if search is not None:
+ groups = search.groups()
+ return groups[0]
+ else:
+ return None
class XPathSearchErrorResult(XPathErrorResult):
def __init__(self, error, xpath):
Please sign in to comment.
Something went wrong with that request. Please try again.