Skip to content

Commit

Permalink
matching the version only at the begining of lines
Browse files Browse the repository at this point in the history
  • Loading branch information
deronnax committed Mar 26, 2015
1 parent ce234d5 commit 1145fe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

version = ''
with open('requests/__init__.py', 'r') as fd:
version = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read()).group(1)
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)

if not version:
raise RuntimeError('Cannot find version information')
Expand Down

0 comments on commit 1145fe6

Please sign in to comment.