aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-09 03:34:35 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-09 03:34:35 -0500
commit41112f5afd0d2b0c14899ab1cf2c27183e64d6ac (patch)
tree81c6998dea813de0f146b2c58125f1226cbadad3 /setuptools/command/egg_info.py
parent1c7e97f95ea74c241b91dfb975c709940ba00f47 (diff)
downloadexternal_python_setuptools-41112f5afd0d2b0c14899ab1cf2c27183e64d6ac.tar.gz
external_python_setuptools-41112f5afd0d2b0c14899ab1cf2c27183e64d6ac.tar.bz2
external_python_setuptools-41112f5afd0d2b0c14899ab1cf2c27183e64d6ac.zip
Use io.open for future compatibility and consistency
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 50f3d5c0..9a9193c1 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -10,6 +10,7 @@ import distutils.filelist
import os
import re
import sys
+import io
try:
from setuptools_svn import svn_utils
@@ -471,10 +472,9 @@ def get_pkg_info_revision():
# a subversion revision
#
if os.path.exists('PKG-INFO'):
- f = open('PKG-INFO', 'rU')
+ with io.open('PKG-INFO') as f:
for line in f:
match = re.match(r"Version:.*-r(\d+)\s*$", line)
if match:
return int(match.group(1))
- f.close()
return 0