Permalink
Browse files

account for libev > 4.00 incompatible changes

  • Loading branch information...
1 parent 4f3c523 commit 6b05dcde7c78b76dc3fbcbf14331b44ccdf8b062 @rep committed May 3, 2011
Showing with 8 additions and 6 deletions.
  1. +7 −5 evnet/__init__.py
  2. +1 −1 setup.py
View
@@ -32,25 +32,27 @@ def _sigint_cb(watcher, events):
if cb.alive():
cb()
- watcher.loop.unloop()
+ unloop(watcher.loop)
def hint(sock):
ip = sock.getsockname()[0]
if not ip.startswith("127."):
hints.add(ip)
-def loop():
+def loop(l=default_loop):
sigint_watcher = pyev.Signal(signal.SIGINT, default_loop, _sigint_cb)
sigint_watcher.start()
- default_loop.loop()
+ if pyev.version()[1] < '4.00': l.loop()
+ else: l.start()
-def unloop():
+def unloop(l=default_loop):
for cb in shutdown_callbacks:
if cb.alive():
cb()
- default_loop.unloop()
+ if pyev.version()[1] < '4.00': l.unloop()
+ else: l.stop()
def connectssl(host, port, cert='cert2.pem'):
return ClientConnection((host,port), cert=cert)
View
@@ -17,7 +17,7 @@ def read_file(name):
setup(
name='evnet',
- version = '1.0-4',
+ version = '1.0-5',
description='evnet is a networking library built on top of pyev (libev)',
long_description=readme,
classifiers=['Development Status :: 4 - Beta','License :: OSI Approved :: MIT License','Programming Language :: Python','Topic :: Software Development :: Libraries :: Python Modules'], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers

0 comments on commit 6b05dcd

Please sign in to comment.