diff --git a/setup.py b/setup.py index 67ca2eed46..f98f5281ca 100755 --- a/setup.py +++ b/setup.py @@ -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')