diff options
Diffstat (limited to 'kombu/asynchronous/debug.py')
-rw-r--r-- | kombu/asynchronous/debug.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kombu/asynchronous/debug.py b/kombu/asynchronous/debug.py index 0e5ffbe0..002c8ec9 100644 --- a/kombu/asynchronous/debug.py +++ b/kombu/asynchronous/debug.py @@ -1,5 +1,4 @@ """Event-loop debugging tools.""" -from __future__ import absolute_import, unicode_literals from kombu.five import items, string_t from kombu.utils.eventio import READ, WRITE, ERR @@ -8,7 +7,7 @@ from kombu.utils.functional import reprcall def repr_flag(flag): """Return description of event loop flag.""" - return '{0}{1}{2}'.format('R' if flag & READ else '', + return '{}{}{}'.format('R' if flag & READ else '', 'W' if flag & WRITE else '', '!' if flag & ERR else '') @@ -32,7 +31,7 @@ def repr_active(h): def repr_events(h, events): """Return description of events returned by poll.""" return ', '.join( - '{0}({1})->{2}'.format( + '{}({})->{}'.format( _rcb(callback_for(h, fd, fl, '(GONE)')), fd, repr_flag(fl), ) @@ -42,13 +41,13 @@ def repr_events(h, events): def repr_readers(h): """Return description of pending readers.""" - return ['({0}){1}->{2}'.format(fd, _rcb(cb), repr_flag(READ | ERR)) + return ['({}){}->{}'.format(fd, _rcb(cb), repr_flag(READ | ERR)) for fd, cb in items(h.readers)] def repr_writers(h): """Return description of pending writers.""" - return ['({0}){1}->{2}'.format(fd, _rcb(cb), repr_flag(WRITE)) + return ['({}){}->{}'.format(fd, _rcb(cb), repr_flag(WRITE)) for fd, cb in items(h.writers)] |