summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@10gen.com>2013-03-28 16:36:50 -0400
committerA. Jesse Jiryu Davis <jesse@10gen.com>2013-03-28 16:36:50 -0400
commite589623c9fbd7ef5245c63949c518fb5b0e6a327 (patch)
tree04365aab217d0b6c683d000e8e14cf96232df9e1
parent80d1312a3e9c869f26fa4790a8978fd7f8486fb1 (diff)
downloadtrollius-git-e589623c9fbd7ef5245c63949c518fb5b0e6a327.tar.gz
Replace deprecated logger.warn with warning
-rw-r--r--tests/tasks_test.py12
-rw-r--r--tulip/selectors.py2
-rw-r--r--tulip/tasks.py5
3 files changed, 10 insertions, 9 deletions
diff --git a/tests/tasks_test.py b/tests/tasks_test.py
index 9ac15bb..ab71386 100644
--- a/tests/tasks_test.py
+++ b/tests/tasks_test.py
@@ -449,8 +449,8 @@ class TaskTests(test_utils.LogTrackingTestCase):
task.set_result('ok')
task._step()
- self.assertTrue(m_logging.warn.called)
- self.assertTrue(m_logging.warn.call_args[0][0].startswith(
+ self.assertTrue(m_logging.warning.called)
+ self.assertTrue(m_logging.warning.call_args[0][0].startswith(
'_step(): already done: '))
@unittest.mock.patch('tulip.tasks.tulip_log')
@@ -462,14 +462,14 @@ class TaskTests(test_utils.LogTrackingTestCase):
task = tasks.Task(notmuch())
task._step()
- self.assertFalse(m_logging.warn.called)
+ self.assertFalse(m_logging.warning.called)
task._step()
- self.assertTrue(m_logging.warn.called)
+ self.assertTrue(m_logging.warning.called)
self.assertEqual(
'_step(): bad yield: %r',
- m_logging.warn.call_args[0][0])
- self.assertEqual(1, m_logging.warn.call_args[0][1])
+ m_logging.warning.call_args[0][0])
+ self.assertEqual(1, m_logging.warning.call_args[0][1])
def test_step_result_future(self):
# If coroutine returns future, task waits on this future.
diff --git a/tulip/selectors.py b/tulip/selectors.py
index 57be7ab..bd81e55 100644
--- a/tulip/selectors.py
+++ b/tulip/selectors.py
@@ -196,7 +196,7 @@ class _BaseSelector:
try:
return self._fd_to_key[fd]
except KeyError:
- tulip_log.warn('No key found for fd %r', fd)
+ tulip_log.warning('No key found for fd %r', fd)
return None
diff --git a/tulip/tasks.py b/tulip/tasks.py
index 81359a2..f385f49 100644
--- a/tulip/tasks.py
+++ b/tulip/tasks.py
@@ -102,7 +102,8 @@ class Task(futures.Future):
def _step(self, value=None, exc=None):
if self.done():
- tulip_log.warn('_step(): already done: %r, %r, %r', self, value, exc)
+ tulip_log.warning(
+ '_step(): already done: %r, %r, %r', self, value, exc)
return
# We'll call either coro.throw(exc) or coro.send(value).
if self._must_cancel:
@@ -162,7 +163,7 @@ class Task(futures.Future):
'generator in task %r with %s' % (self, result)))
else:
if result is not None:
- tulip_log.warn('_step(): bad yield: %r', result)
+ tulip_log.warning('_step(): bad yield: %r', result)
self._event_loop.call_soon(self._step)