From 4b1ba9474784c626a16d9259976abe9bb04db19f Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 16 Oct 2019 13:02:02 -0500 Subject: [PATCH] Simplify and improve clarity of setup.py --- setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) -- 2.25.1