From: Harmon Date: Wed, 16 Oct 2019 18:02:02 +0000 (-0500) Subject: Simplify and improve clarity of setup.py X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4b1ba9474784c626a16d9259976abe9bb04db19f;p=tweepy.git Simplify and improve clarity of setup.py --- diff --git a/setup.py b/setup.py index b7179c3..9ecb639 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,12 @@ #!/usr/bin/env python -# from distutils.core import setup import re from setuptools import find_packages, setup VERSION_FILE = "tweepy/__init__.py" -VERSION_REGEX = r"^__version__ = ['\"]([^'\"]*)['\"]" -with open(VERSION_FILE, "rt") as version_file: - match = re.search(VERSION_REGEX, version_file.read(), re.M) +with open(VERSION_FILE) as version_file: + match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file.read(), re.MULTILINE) if match: version = match.group(1)