projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b47d6d
)
Properly handle and close file in setup.py
author
Harmon
<Harmon758@gmail.com>
Wed, 16 Oct 2019 17:50:02 +0000
(12:50 -0500)
committer
Harmon
<Harmon758@gmail.com>
Wed, 16 Oct 2019 17:50:02 +0000
(12:50 -0500)
setup.py
patch
|
blob
|
blame
|
history
diff --git
a/setup.py
b/setup.py
index 3cf35899ac811a16898b3368be1756e48fe967cd..226988a79a4d84249840667feccb14ba9c6b622f 100644
(file)
--- a/
setup.py
+++ b/
setup.py
@@
-5,9
+5,9
@@
import re
from setuptools import find_packages, setup
VERSIONFILE = "tweepy/__init__.py"
-ver_file = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
-mo = re.search(VSRE, ver_file, re.M)
+with open(VERSIONFILE, "rt") as ver_file:
+ mo = re.search(VSRE, ver_file.read(), re.M)
if mo:
version = mo.group(1)