Commit aa0d5f77 authored by Denis Bilenko's avatar Denis Bilenko

pep8 fixes

parent 96de7856
......@@ -190,8 +190,8 @@ htmlhelp_basename = 'geventdoc'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'gevent.tex', u'gevent Documentation',
u'gevent contributors', 'manual'),
('index', 'gevent.tex', u'gevent Documentation',
u'gevent contributors', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
......
......@@ -4,8 +4,11 @@ try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
sys.stderr.write("""Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.
You'll have to run django-admin.py, passing it your settings module.
(If the file settings.py does indeed exist, it's causing an ImportError somehow.)
""" % __file__)
raise
if __name__ == "__main__":
execute_manager(settings)
......@@ -8,6 +8,6 @@ urlpatterns = patterns('webchat.chat.views',
urlpatterns += patterns('django.views.static',
(r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'),
'serve', {
'document_root': settings.MEDIA_ROOT,
'show_indexes': True}))
'serve', {
'document_root': settings.MEDIA_ROOT,
'show_indexes': True}))
......@@ -40,7 +40,7 @@ class RLock(object):
def __repr__(self):
owner = self.__owner
return "<%s owner=%r count=%d>" % (
self.__class__.__name__, owner, self.__count)
self.__class__.__name__, owner, self.__count)
def acquire(self, blocking=1):
me = get_ident()
......
......@@ -192,11 +192,11 @@ class RLock(object):
def __repr__(self):
return "<%s at 0x%x _block=%s _count=%r _owner=%r)>" % (
self.__class__.__name__,
id(self),
self._block,
self._count,
self._owner)
self.__class__.__name__,
id(self),
self._block,
self._count,
self._owner)
def acquire(self, blocking=1):
me = getcurrent()
......
......@@ -50,7 +50,7 @@ def posix_read(fd, n):
flags = _map_errors(fcntl.fcntl, fd, fcntl.F_GETFL, 0)
blocking_fd = not bool(flags & os.O_NONBLOCK)
if blocking_fd:
_map_errors(fcntl.fcntl, fd, fcntl.F_SETFL, flags|os.O_NONBLOCK)
_map_errors(fcntl.fcntl, fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)
try:
return _read(fd, n)
except OSError, e:
......@@ -81,7 +81,7 @@ def posix_write(fd, buf):
flags = _map_errors(fcntl.fcntl, fd, fcntl.F_GETFL, 0)
blocking_fd = not bool(flags & os.O_NONBLOCK)
if blocking_fd:
_map_errors(fcntl.fcntl, fd, fcntl.F_SETFL, flags|os.O_NONBLOCK)
_map_errors(fcntl.fcntl, fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)
try:
return _write(fd, buf)
except OSError, e:
......
......@@ -336,7 +336,6 @@ class LifoQueue(Queue):
else:
self.queue = []
def _put(self, item):
self.queue.append(item)
......
......@@ -56,7 +56,7 @@ class Resolver(object):
self.fork_watcher.stop()
def gethostbyname(self, hostname, family=AF_INET):
if family==AF_INET and self.pool is not None and '.' not in hostname:
if family == AF_INET and self.pool is not None and '.' not in hostname:
return self.pool.apply_e(BaseException, gethostbyname, (hostname, ))
return self.gethostbyname_ex(hostname, family)[-1][0]
......@@ -66,7 +66,7 @@ class Resolver(object):
elif not isinstance(hostname, str):
raise TypeError('Expected string, not %s' % type(hostname).__name__)
if family==AF_INET and self.pool is not None and '.' not in hostname:
if family == AF_INET and self.pool is not None and '.' not in hostname:
return self.pool.apply_e(BaseException, gethostbyname_ex, (hostname, ))
while True:
......
......@@ -253,8 +253,8 @@ class SSLSocket(socket):
if self._sslobj:
if flags != 0:
raise ValueError(
"non-zero flags not allowed in calls to recv_into() on %s" %
self.__class__)
"non-zero flags not allowed in calls to recv_into() on %s" %
self.__class__)
while True:
try:
tmp_buffer = self.read(nbytes)
......
......@@ -363,13 +363,12 @@ class Popen(object):
def _make_inheritable(self, handle):
"""Return a duplicate of handle, which is inheritable"""
return DuplicateHandle(GetCurrentProcess(),
handle, GetCurrentProcess(), 0, 1,
DUPLICATE_SAME_ACCESS)
handle, GetCurrentProcess(), 0, 1,
DUPLICATE_SAME_ACCESS)
def _find_w9xpopen(self):
"""Find and return absolut path to w9xpopen.exe"""
w9xpopen = os.path.join(
os.path.dirname(GetModuleFileName(0)),
w9xpopen = os.path.join(os.path.dirname(GetModuleFileName(0)),
"w9xpopen.exe")
if not os.path.exists(w9xpopen):
# Eeek - file-not-found - possibly an embedding
......@@ -407,8 +406,7 @@ class Popen(object):
startupinfo.wShowWindow = SW_HIDE
comspec = os.environ.get("COMSPEC", "cmd.exe")
args = '{} /c "{}"'.format(comspec, args)
if (GetVersion() >= 0x80000000 or
os.path.basename(comspec).lower() == "command.com"):
if GetVersion() >= 0x80000000 or os.path.basename(comspec).lower() == "command.com":
# Win9x, or using command.com on NT. We need to
# use the w9xpopen intermediate program. For more
# information, see KB Q150956
......@@ -426,13 +424,13 @@ class Popen(object):
# Start the process
try:
hp, ht, pid, tid = CreateProcess(executable, args,
# no special security
None, None,
int(not close_fds),
creationflags,
env,
cwd,
startupinfo)
# no special security
None, None,
int(not close_fds),
creationflags,
env,
cwd,
startupinfo)
except pywintypes.error, e:
# Translate pywintypes.error to WindowsError, which is
# a subclass of OSError. FIXME: We should really
......
......@@ -25,7 +25,7 @@ def bench_gevent(arg=0):
import gevent
from gevent import sleep
delta = test(sleep, arg)
print ('gevent %s (%s): sleep(%r): %.1f microseconds' % (gevent.__version__, gevent.__file__, arg, delta * 1000000./N))
print ('gevent %s (%s): sleep(%r): %.1f microseconds' % (gevent.__version__, gevent.__file__, arg, delta * 1000000. / N))
def bench_eventlet(arg):
......@@ -36,7 +36,7 @@ def bench_eventlet(arg):
return
from eventlet.api import sleep
delta = test(sleep, arg)
print ('eventlet %s (%s): sleep(%r): %.1f microseconds' % (eventlet.__version__, eventlet.__file__, arg, delta * 1000000./N))
print ('eventlet %s (%s): sleep(%r): %.1f microseconds' % (eventlet.__version__, eventlet.__file__, arg, delta * 1000000. / N))
def main():
......
......@@ -73,16 +73,19 @@ def wrap_switch_count_check(method):
def wrap_timeout(timeout, method):
if timeout is None:
return method
@wraps(method)
def wrapped(self, *args, **kwargs):
with gevent.Timeout(timeout, 'test timed out'):
return method(self, *args, **kwargs)
return wrapped
def wrap_refcount(method):
if gettotalrefcount is None:
return method
@wraps(method)
def wrapped(self, *args, **kwargs):
import gc
......@@ -127,6 +130,7 @@ def wrap_refcount(method):
gc.collect()
gc.enable()
self.skipTearDown = True
return wrapped
......@@ -260,7 +264,7 @@ class TestCase(BaseTestCase):
if error is None:
error = self.get_error()
if type is not None:
assert error[1] is type, error
assert error[1] is type, error
if value is not None:
if isinstance(value, str):
assert str(error[2]) == value, error
......
......@@ -44,7 +44,7 @@ test_patched_threading.*
def make_re(tests):
tests = [x.strip().replace('\.', '\\.').replace('*', '.*?') for x in tests.split('\n') if x.strip()]
tests = [x.strip().replace('\.', '\\.').replace('*', '.*?') for x in tests.split('\n') if x.strip()]
tests = re.compile('^%s$' % '|'.join(tests))
return tests
......
......@@ -11,13 +11,11 @@ if PY3:
import builtins
exec_ = getattr(builtins, "exec")
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
raise value
print_ = getattr(builtins, "print")
del builtins
......@@ -33,6 +31,3 @@ else:
elif locs is None:
locs = globs
exec("""exec code in globs, locs""")
......@@ -34,8 +34,8 @@ class Test_wsgiserver(util.TestServer):
class Test_wsgiserver_ssl(Test_wsgiserver):
server = 'wsgiserver_ssl.py'
URL = 'https://localhost:8443'
server = 'wsgiserver_ssl.py'
URL = 'https://localhost:8443'
class Test_webproxy(Test_wsgiserver):
......@@ -51,21 +51,21 @@ class Test_webproxy(Test_wsgiserver):
class Test_webpy(Test_wsgiserver):
server = 'webpy.py'
not_found_message = 'not found'
def _test_hello(self):
status, data = self.read('/')
self.assertEqual(status, '200 OK')
assert "Hello, world" in data, repr(data)
def _test_long(self):
start = time.time()
status, data = self.read('/long')
delay = time.time() - start
assert 10 - 0.5 < delay < 10 + 0.5, delay
self.assertEqual(status, '200 OK')
self.assertEqual(data, 'Hello, 10 seconds later')
server = 'webpy.py'
not_found_message = 'not found'
def _test_hello(self):
status, data = self.read('/')
self.assertEqual(status, '200 OK')
assert "Hello, world" in data, repr(data)
def _test_long(self):
start = time.time()
status, data = self.read('/long')
delay = time.time() - start
assert 10 - 0.5 < delay < 10 + 0.5, delay
self.assertEqual(status, '200 OK')
self.assertEqual(data, 'Hello, 10 seconds later')
if __name__ == '__main__':
......
......@@ -36,16 +36,18 @@ def main():
from testrunner import pool
import time
failed = []
def run(name, cmd, **kwargs):
if util.run(cmd, **kwargs):
failed.append(name)
start = time.time()
total = 0
for name, cmd, options in TESTRUNNER(sys.argv[1:]):
total += 1
pool.spawn(run, name, cmd, **options)
gevent.run()
util.report(total, failed, took=time.time()-start)
util.report(total, failed, took=time.time() - start)
if __name__ == '__main__':
......
......@@ -56,7 +56,6 @@ class Test(greentest.TestCase):
finally:
server.stop()
def test_banner(self):
banner = "Welcome stranger!"
server = backdoor.BackdoorServer(('127.0.0.1', 0), banner=banner)
......
......@@ -21,13 +21,13 @@ class Test(TestCase):
self.assertEqual(core.loop(2, default=False).backend_int, 2)
self.assertEqual(core.loop('select', default=False).backend, 'select')
self.assertEqual(core._flags_to_int(None), 0)
self.assertEqual(core._flags_to_int(['kqueue', 'SELECT']), core.BACKEND_KQUEUE|core.BACKEND_SELECT)
self.assertEqual(core._flags_to_list(core.BACKEND_PORT|core.BACKEND_POLL), ['port', 'poll'])
self.assertEqual(core._flags_to_int(['kqueue', 'SELECT']), core.BACKEND_KQUEUE | core.BACKEND_SELECT)
self.assertEqual(core._flags_to_list(core.BACKEND_PORT | core.BACKEND_POLL), ['port', 'poll'])
self.assertRaises(ValueError, core.loop, ['port', 'blabla'])
self.assertRaises(TypeError, core.loop, object())
def test_events_conversion(self):
self.assertEqual(core._events_to_str(core.READ|core.WRITE), 'READ|WRITE')
self.assertEqual(core._events_to_str(core.READ | core.WRITE), 'READ|WRITE')
def test_EVENTS(self):
self.assertEqual(str(core.EVENTS), 'gevent.core.EVENTS')
......
......@@ -5,7 +5,7 @@ import os
import time
filename = 'test__core_stat.%s' % os.getpid()
filename = 'tmp.test__core_stat.%s' % os.getpid()
hub = gevent.get_hub()
......@@ -18,7 +18,7 @@ try:
assert os.path.exists(filename), filename
def write():
f= open(filename, 'wb', buffering=0)
f = open(filename, 'wb', buffering=0)
f.write('x')
f.close()
......
......@@ -9,9 +9,11 @@ class Test_udp_client(TestCase):
def test(self):
log = []
def handle(message, address):
log.append(message)
server.sendto('reply-from-server', address)
server = DatagramServer('127.0.0.1:9000', handle)
server.start()
try:
......
import gevent
def func():
pass
a = gevent.spawn(func)
b = gevent.spawn(func)
gevent.joinall([a, b, a])
......@@ -13,7 +13,7 @@ class A(local):
path = ''
def __init__(self, obj):
if not hasattr(self, 'initialized'):
if not hasattr(self, 'initialized'):
self.obj = obj
self.path = ''
......
......@@ -2,6 +2,7 @@ from gevent.core import loop
count = 0
def incr():
global count
count += 1
......
......@@ -17,8 +17,10 @@ class Test(greentest.TestCase):
g = gevent.spawn(self.lst.append, 0)
class appender(object):
def __init__(myself, item):
myself.item = item
def __call__(myself, *args):
self.lst.append(myself.item)
......
......@@ -27,14 +27,17 @@ class TestOS(TestCase):
# Lack of "nonlocal" keyword in Python 2.x:
bytesread = [0]
byteswritten = [0]
def produce():
while byteswritten[0] != nbytes:
bytesleft = nbytes - byteswritten[0]
byteswritten[0] += os.write(w, buf[:min(bytesleft, 4096)])
def consume():
while bytesread[0] != nbytes:
bytesleft = nbytes - bytesread[0]
bytesread[0] += len(os.read(r, min(bytesleft, 4096)))
producer = Greenlet(produce)
producer.start()
consumer = Greenlet(consume)
......@@ -68,7 +71,7 @@ class TestOS(TestCase):
r, w = os.pipe()
rflags = fcntl.fcntl(r, fcntl.F_GETFL, 0)
fcntl.fcntl(r, fcntl.F_SETFL, rflags|os.O_NONBLOCK)
fcntl.fcntl(r, fcntl.F_SETFL, rflags | os.O_NONBLOCK)
gotEAGAIN = False
try:
......@@ -100,7 +103,7 @@ class TestOS(TestCase):
r, w = os.pipe()
wflags = fcntl.fcntl(r, fcntl.F_GETFL, 0)
fcntl.fcntl(w, fcntl.F_SETFL, wflags|os.O_NONBLOCK)
fcntl.fcntl(w, fcntl.F_SETFL, wflags | os.O_NONBLOCK)
data = "d" * 1000000
......
......@@ -67,7 +67,7 @@ class TestCoroutinePool(greentest.TestCase):
def test_reentrant(self):
pool = self.klass(1)
result = pool.apply(pool.apply, (lambda a: a+1, (5, )))
result = pool.apply(pool.apply, (lambda a: a + 1, (5, )))
self.assertEqual(result, 6)
evt = Event()
pool.apply_async(evt.set)
......@@ -398,8 +398,10 @@ class TestErrorInIterator(greentest.TestCase):
def test_unordered(self):
p = pool.Pool(3)
def unordered():
return list(p.imap_unordered(lambda x: None, error_iter()))
self.assertRaises(ExpectedException, unordered)
gevent.sleep(0.001)
......
......@@ -138,7 +138,7 @@ class Response(object):
def assertHeader(self, header, value):
real_value = self.headers.get(header, False)
assert real_value == value, \
'Unexpected header %r: %r (expected %r)\n%s' % (header, real_value, value, self)
'Unexpected header %r: %r (expected %r)\n%s' % (header, real_value, value, self)
def assertBody(self, body):
assert self.body == body, 'Unexpected body: %r (expected %r)\n%s' % (self.body, body, self)
......
......@@ -260,7 +260,7 @@ class TestNoWait(TestCase):
run_callback(store_result, util.wrap_errors(Full, q.put_nowait), 3)
gevent.sleep(0)
assert len(result) == 2, result
assert result[0] == None, result
assert result[0] is None, result
assert isinstance(result[1], queue.Full), result
def test_get_nowait_simple(self):
......
......@@ -262,7 +262,7 @@ class TestDefaultSpawn(TestCase):
except socket.error:
ex = sys.exc_info()[1]
if ex.args[0] == 10053:
pass # "established connection was aborted by the software in your host machine"
pass # "established connection was aborted by the software in your host machine"
elif ex.args[0] == errno.ECONNRESET:
pass
else:
......
......@@ -179,7 +179,7 @@ class TestCase(greentest.TestCase):
self.assertEqualResults(real_result, gevent_result, func, args)
if time_gevent > time_real + 0.01 and time_gevent > 0.02:
msg = 'gevent:%s%s took %dms versus %dms stdlib' % (func, args, time_gevent * 1000.0, time_real * 1000.0)
msg = 'gevent:%s%s took %dms versus %dms stdlib' % (func, args, time_gevent * 1000.0, time_real * 1000.0)
if time_gevent > time_real + 1:
word = 'VERY'
......
......@@ -8,8 +8,7 @@ import time
if subprocess.mswindows:
SETBINARY = ('import msvcrt; msvcrt.setmode(sys.stdout.fileno(), '
'os.O_BINARY);')
SETBINARY = 'import msvcrt; msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY);'
else:
SETBINARY = ''
......@@ -39,12 +38,12 @@ class Test(greentest.TestCase):
def test_communicate(self):
p = subprocess.Popen([sys.executable, "-c",
'import sys,os;'
'sys.stderr.write("pineapple");'
'sys.stdout.write(sys.stdin.read())'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
'import sys,os;'
'sys.stderr.write("pineapple");'
'sys.stdout.write(sys.stdin.read())'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate("banana")
self.assertEqual(stdout, "banana")
if sys.executable.endswith('-dbg'):
......@@ -54,20 +53,20 @@ class Test(greentest.TestCase):
def test_universal1(self):
p = subprocess.Popen([sys.executable, "-c",
'import sys,os;' + SETBINARY +
'sys.stdout.write("line1\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line2\\r");'
'sys.stdout.flush();'
'sys.stdout.write("line3\\r\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line4\\r");'
'sys.stdout.flush();'
'sys.stdout.write("\\nline5");'
'sys.stdout.flush();'
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE,
universal_newlines=1)
'import sys,os;' + SETBINARY +
'sys.stdout.write("line1\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line2\\r");'
'sys.stdout.flush();'
'sys.stdout.write("line3\\r\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line4\\r");'
'sys.stdout.flush();'
'sys.stdout.write("\\nline5");'
'sys.stdout.flush();'
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE,
universal_newlines=1)
try:
stdout = p.stdout.read()
if hasattr(file, 'newlines'):
......@@ -83,18 +82,18 @@ class Test(greentest.TestCase):
def test_universal2(self):
p = subprocess.Popen([sys.executable, "-c",
'import sys,os;' + SETBINARY +
'sys.stdout.write("line1\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line2\\r");'
'sys.stdout.flush();'
'sys.stdout.write("line3\\r\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line4\\r\\nline5");'
'sys.stdout.flush();'
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE,
universal_newlines=1)
'import sys,os;' + SETBINARY +
'sys.stdout.write("line1\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line2\\r");'
'sys.stdout.flush();'
'sys.stdout.write("line3\\r\\n");'
'sys.stdout.flush();'
'sys.stdout.write("line4\\r\\nline5");'
'sys.stdout.flush();'
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE,
universal_newlines=1)
try:
stdout = p.stdout.read()
if hasattr(file, 'newlines'):
......
......@@ -237,6 +237,7 @@ def error_iter():
class TestErrorInIterator(TestCase):
error_fatal = False
def test(self):
......@@ -246,8 +247,10 @@ class TestErrorInIterator(TestCase):
def test_unordered(self):
self.pool = ThreadPool(3)
def unordered():
return list(self.pool.imap_unordered(lambda x: None, error_iter()))
self.assertRaises(greentest.ExpectedException, unordered)
gevent.sleep(0.001)
......@@ -288,11 +291,15 @@ class TestSize(TestCase):
self.assertEqual(pool.size, 2)
pool.size = 1
self.assertEqual(pool.size, 1)
def set_neg():
pool.size = -1
self.assertRaises(ValueError, set_neg)
def set_too_big():
pool.size = 3
self.assertRaises(ValueError, set_too_big)
pool.size = 0
self.assertEqual(pool.size, 0)
......@@ -303,7 +310,7 @@ class TestSize(TestCase):
class TestRef(TestCase):
def test(self):
pool = self.pool=ThreadPool(2)
pool = self.pool = ThreadPool(2)
refs = []
obj = SomeClass()
......
......@@ -11,4 +11,3 @@ gevent.sleep(0.01)
res = gevent.get_hub().join()
assert res is True, res
......@@ -9,7 +9,7 @@ SMALL = 0.1
FUZZY = SMALL / 2
# setting up signal does not affect join()
gevent.signal(1, lambda : None) # wouldn't work on windows
gevent.signal(1, lambda: None) # wouldn't work on windows
@contextmanager
......@@ -75,7 +75,7 @@ for _a in xrange(2):
# checking "ref=False" argument
for _ in xrange(2):
gevent.get_hub().loop.timer(10, ref=False).start(lambda : None)
gevent.get_hub().loop.timer(10, ref=False).start(lambda: None)
with no_time():
result = gevent.get_hub().join()
assert result is True
......@@ -83,7 +83,7 @@ for _a in xrange(2):
# checking "ref=False" attribute
for _d in xrange(2):
w = gevent.get_hub().loop.timer(10)
w.start(lambda : None)
w.start(lambda: None)
w.ref = False
with no_time():
result = gevent.get_hub().join()
......
......@@ -13,8 +13,6 @@ import util
TIMEOUT = 120
NWORKERS = int(os.environ.get('NWORKERS') or 8)
pool = Pool(NWORKERS)
util.BUFFER_OUTPUT = NWORKERS != 1
def info():
......@@ -44,6 +42,10 @@ def main():
tests = set(glob.glob('test_*.py')) - set(['test_support.py'])
tests = sorted(tests)
NWORKERS = max(len(tests), NWORKERS)
util.BUFFER_OUTPUT = NWORKERS > 1
pool = Pool(NWORKERS)
def run_one(name, cmd, **kwargs):
result = util.run(cmd, **kwargs)
if result:
......
......@@ -14,11 +14,13 @@ commands = [
'pep8 --show-source --max-line-length=160 gevent/ setup.py',
'pep8 --show-source --max-line-length=160 --ignore E702 examples/*.py',
'pep8 --show-source --max-line-length=160 --ignore E702,E128 examples/webchat',
'pep8 --show-source --max-line-length=160 doc/']
'pep8 --show-source --max-line-length=160 doc/',
"pep8 --max-line-length=200 --exclude 'test_support.py,test_queue.py,lock_tests.py,patched_tests_setup.py,test_threading_2.py' --ignore E702 greentest/*.py",
'pep8 --show-source --max-line-length=160 --ignore E203,E128,E124,E201 greentest/patched_tests_setup.py']
failures = 0
for command in commands:
sys.stderr.write('+ %s\n' % command)
if os.system(command):
failures += 1
......
......@@ -37,8 +37,7 @@ def test_main():
# re-raises information about any exceptions the child
# throws. The real work happens in self.run_test().
os_done_r, os_done_w = os.pipe()
with closing(os.fdopen(os_done_r)) as done_r, \
closing(os.fdopen(os_done_w, 'w')) as done_w:
with closing(os.fdopen(os_done_r)) as done_r, closing(os.fdopen(os_done_w, 'w')) as done_w:
child = gevent.fork()
if not child:
# In the child process; run the test and report results
......
......@@ -294,17 +294,17 @@ def run_setup(ext_modules):
cmdclass=dict(build_ext=my_build_ext, sdist=sdist),
install_requires=['greenlet'],
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
"Intended Audience :: Developers",
"Development Status :: 4 - Beta"])
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
"Intended Audience :: Developers",
"Development Status :: 4 - Beta"])
if __name__ == '__main__':
......
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