Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor checks

  • Loading branch information...
commit 91bcc03262c6262e130e1747e907bb64882a2f93 1 parent 9357b4d
Alvaro authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 evy/uv/watchers.py
View
15 evy/uv/watchers.py
@@ -46,8 +46,8 @@ class Watcher(object):
libuv_handle_type = 'uv_handle_t *'
hub = None
+ callback = None
- _callback = None
_flags = 0
_start_func = None
_stop_func = None
@@ -76,7 +76,7 @@ def _run_callback(self, handle, *args):
It will call the callback provided on the start() method
"""
- uv_handle = self._cast_libuv_handle(handle)
+ #uv_handle = self._cast_libuv_handle(handle)
if self.callback:
try:
@@ -148,7 +148,8 @@ def start(self, callback, *args, **kwargs):
:param callback: callback to invoke when the watcher is done
:param args: arguments for calling the callback
"""
- self.callback = partial(callback, *args, **kwargs)
+ if callback: self.callback = partial(callback, *args, **kwargs)
+
self._libuv_unref()
if self._start_func: self._start_func()
@@ -259,7 +260,7 @@ def start(self, callback, *args, **kwargs):
:param kw: keywords arguments for calling the callback
:return: None
"""
- self.callback = partial(callback, *args, **kwargs)
+ if callback: self.callback = partial(callback, *args, **kwargs)
self._libuv_unref()
@@ -345,7 +346,7 @@ def start(self, callback, *args, **kwargs):
:return: None
"""
update = kwargs.get("update", True)
- self.callback = partial(callback, *args, **kwargs)
+ if callback: self.callback = partial(callback, *args, **kwargs)
self._libuv_unref()
@@ -368,7 +369,7 @@ def again(self, callback, *args, **kwargs):
Stop the timer, and if it is repeating restart it using the repeat value as the timeout.
"""
update = kwargs.get("update", True)
- self.callback = partial(callback, *args, **kwargs)
+ if callback: self.callback = partial(callback, *args, **kwargs)
self._libuv_unref()
if update:
@@ -442,7 +443,7 @@ def start(self, callback, *args, **kwargs):
:param kw: keywords arguments for calling the callback
:return: None
"""
- self.callback = partial(callback, *args, **kwargs)
+ if callback: self.callback = partial(callback, *args, **kwargs)
self._libuv_unref()
Please sign in to comment.
Something went wrong with that request. Please try again.