Simplify and improve clarity of setup.py
authorHarmon <Harmon758@gmail.com>
Wed, 16 Oct 2019 18:02:02 +0000 (13:02 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 16 Oct 2019 18:02:02 +0000 (13:02 -0500)
setup.py

index b7179c353fbe7c1335909fad8c413642de0b480c..9ecb6394df556d2f3545af7a1fd72307d7e69e9c 100644 (file)
--- 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)