Commit 5f540971 authored by Jason Madden's avatar Jason Madden

Note that Python 2.5 support has been dropped. Add version and implementation...

Note that Python 2.5 support has been dropped. Add version and implementation classifiers to setup.py; make setup.py PyPy/Py3 friendly and not leak open files. [skip ci]
parent 833f8d13
...@@ -9,6 +9,8 @@ Unreleased ...@@ -9,6 +9,8 @@ Unreleased
- Add support for Python 3.3 and 3.4. - Add support for Python 3.3 and 3.4.
- Add support for PyPy. - Add support for PyPy.
- Drop support for Python 2.5. Python 2.5 users can continue to use
gevent 1.0.x.
- Fix gevent.greenlet.joinall to not ignore ``count`` when - Fix gevent.greenlet.joinall to not ignore ``count`` when
``raise_error`` is False. PR #512 by Ivan Diao. ``raise_error`` is False. PR #512 by Ivan Diao.
- Fix subprocess.Popen to not ignore the ``bufsize`` argument. Note - Fix subprocess.Popen to not ignore the ``bufsize`` argument. Note
......
...@@ -24,7 +24,8 @@ from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatfo ...@@ -24,7 +24,8 @@ from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatfo
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError, IOError) ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError, IOError)
__version__ = re.search("__version__\s*=\s*'(.*)'", open('gevent/__init__.py').read(), re.M).group(1) with open('gevent/__init__.py') as _:
__version__ = re.search(r"__version__\s*=\s*'(.*)'", _.read(), re.M).group(1)
assert __version__ assert __version__
...@@ -90,21 +91,21 @@ ARES.optional = True ...@@ -90,21 +91,21 @@ ARES.optional = True
def make_universal_header(filename, *defines): def make_universal_header(filename, *defines):
defines = [('#define %s ' % define, define) for define in defines] defines = [('#define %s ' % define, define) for define in defines]
lines = open(filename, 'r').read().split('\n') with open(filename, 'r') as f:
lines = f.read().split('\n')
ifdef = 0 ifdef = 0
f = open(filename, 'w') with open(filename, 'w') as f:
for line in lines: for line in lines:
if line.startswith('#ifdef'): if line.startswith('#ifdef'):
ifdef += 1 ifdef += 1
elif line.startswith('#endif'): elif line.startswith('#endif'):
ifdef -= 1 ifdef -= 1
elif not ifdef: elif not ifdef:
for prefix, define in defines: for prefix, define in defines:
if line.startswith(prefix): if line.startswith(prefix):
line = '#ifdef __LP64__\n#define %s 8\n#else\n#define %s 4\n#endif' % (define, define) line = '#ifdef __LP64__\n#define %s 8\n#else\n#define %s 4\n#endif' % (define, define)
break break
print(line, file=f) print(line, file=f)
f.close()
def _system(cmd): def _system(cmd):
...@@ -280,7 +281,8 @@ class BuildFailed(Exception): ...@@ -280,7 +281,8 @@ class BuildFailed(Exception):
def read(name, *args): def read(name, *args):
try: try:
return open(join(dirname(__file__), name)).read(*args) with open(join(dirname(__file__), name)) as f:
return f.read(*args)
except OSError: except OSError:
return '' return ''
...@@ -336,6 +338,10 @@ def run_setup(ext_modules, run_make): ...@@ -336,6 +338,10 @@ def run_setup(ext_modules, run_make):
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7", "Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: MacOS :: MacOS X", "Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX", "Operating System :: POSIX",
"Operating System :: Microsoft :: Windows", "Operating System :: Microsoft :: Windows",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment