Explorar o código

Do not subclass from object (this is fun)

Ask Solem %!s(int64=8) %!d(string=hai) anos
pai
achega
99957e2334
Modificáronse 100 ficheiros con 199 adicións e 196 borrados
  1. 1 1
      celery/app/amqp.py
  2. 1 1
      celery/app/base.py
  3. 2 2
      celery/app/control.py
  4. 1 1
      celery/app/defaults.py
  5. 1 1
      celery/app/log.py
  6. 2 2
      celery/app/routes.py
  7. 2 2
      celery/app/task.py
  8. 1 1
      celery/app/trace.py
  9. 1 1
      celery/app/utils.py
  10. 2 2
      celery/apps/beat.py
  11. 3 3
      celery/backends/async.py
  12. 2 2
      celery/backends/base.py
  13. 1 1
      celery/backends/cache.py
  14. 1 1
      celery/backends/database/session.py
  15. 3 3
      celery/beat.py
  16. 2 2
      celery/bin/amqp.py
  17. 2 2
      celery/bin/base.py
  18. 1 1
      celery/bin/celeryd_detach.py
  19. 1 1
      celery/bin/graph.py
  20. 1 1
      celery/bin/logtool.py
  21. 2 2
      celery/bin/multi.py
  22. 2 2
      celery/bootsteps.py
  23. 1 1
      celery/canvas.py
  24. 1 1
      celery/concurrency/base.py
  25. 1 1
      celery/contrib/migrate.py
  26. 2 2
      celery/events/__init__.py
  27. 1 1
      celery/events/cursesmon.py
  28. 1 1
      celery/events/dumper.py
  29. 1 1
      celery/events/snapshot.py
  30. 3 3
      celery/events/state.py
  31. 1 1
      celery/five.py
  32. 2 2
      celery/fixups/django.py
  33. 1 1
      celery/loaders/base.py
  34. 1 1
      celery/local.py
  35. 3 3
      celery/platforms.py
  36. 1 1
      celery/result.py
  37. 2 2
      celery/schedules.py
  38. 2 2
      celery/security/certificate.py
  39. 1 1
      celery/security/key.py
  40. 1 1
      celery/security/serialization.py
  41. 1 1
      celery/task/base.py
  42. 1 1
      celery/tests/app/test_annotations.py
  43. 9 9
      celery/tests/app/test_app.py
  44. 2 2
      celery/tests/app/test_beat.py
  45. 2 2
      celery/tests/app/test_log.py
  46. 3 3
      celery/tests/backends/test_amqp.py
  47. 1 1
      celery/tests/backends/test_base.py
  48. 2 2
      celery/tests/backends/test_cache.py
  49. 3 3
      celery/tests/backends/test_cassandra.py
  50. 1 1
      celery/tests/backends/test_database.py
  51. 5 5
      celery/tests/backends/test_redis.py
  52. 1 1
      celery/tests/bin/test_base.py
  53. 1 1
      celery/tests/bin/test_events.py
  54. 1 1
      celery/tests/bin/test_multi.py
  55. 3 3
      celery/tests/bin/test_worker.py
  56. 2 2
      celery/tests/case.py
  57. 5 5
      celery/tests/concurrency/test_prefork.py
  58. 1 1
      celery/tests/events/test_cursesmon.py
  59. 1 1
      celery/tests/events/test_events.py
  60. 2 2
      celery/tests/events/test_snapshot.py
  61. 1 1
      celery/tests/events/test_state.py
  62. 3 2
      celery/tests/utils/test_deprecated.py
  63. 1 1
      celery/tests/utils/test_dispatcher.py
  64. 1 1
      celery/tests/utils/test_encoding.py
  65. 2 2
      celery/tests/utils/test_functional.py
  66. 14 14
      celery/tests/utils/test_local.py
  67. 7 5
      celery/tests/utils/test_platforms.py
  68. 2 2
      celery/tests/utils/test_saferef.py
  69. 4 4
      celery/tests/worker/test_control.py
  70. 2 2
      celery/tests/worker/test_heartbeat.py
  71. 2 2
      celery/tests/worker/test_loops.py
  72. 1 1
      celery/tests/worker/test_request.py
  73. 1 1
      celery/tests/worker/test_state.py
  74. 1 1
      celery/tests/worker/test_strategy.py
  75. 2 2
      celery/tests/worker/test_worker.py
  76. 1 1
      celery/utils/abstract.py
  77. 5 5
      celery/utils/collections.py
  78. 1 1
      celery/utils/deprecated.py
  79. 1 1
      celery/utils/dispatch/saferef.py
  80. 1 1
      celery/utils/dispatch/signal.py
  81. 1 1
      celery/utils/functional.py
  82. 2 2
      celery/utils/graph.py
  83. 1 1
      celery/utils/log.py
  84. 2 2
      celery/utils/objects.py
  85. 1 1
      celery/utils/saferepr.py
  86. 1 1
      celery/utils/sysinfo.py
  87. 1 1
      celery/utils/term.py
  88. 3 3
      celery/utils/threads.py
  89. 2 2
      celery/utils/timeutils.py
  90. 1 1
      celery/worker/__init__.py
  91. 1 1
      celery/worker/consumer/consumer.py
  92. 1 1
      celery/worker/heartbeat.py
  93. 1 1
      celery/worker/pidbox.py
  94. 1 1
      celery/worker/request.py
  95. 1 1
      celery/worker/state.py
  96. 1 1
      docs/internals/app-overview.rst
  97. 6 6
      docs/internals/guide.rst
  98. 4 3
      docs/userguide/application.rst
  99. 3 3
      docs/userguide/configuration.rst
  100. 4 5
      docs/userguide/routing.rst

+ 1 - 1
celery/app/amqp.py

@@ -209,7 +209,7 @@ class Queues(dict):
         return self
 
 
-class AMQP(object):
+class AMQP:
     Connection = Connection
     Consumer = Consumer
     Producer = Producer

+ 1 - 1
celery/app/base.py

@@ -104,7 +104,7 @@ class PendingConfiguration(UserDict, AttributeDictMixin):
 
 
 @python_2_unicode_compatible
-class Celery(object):
+class Celery:
     """Celery application.
 
     Arguments:

+ 2 - 2
celery/app/control.py

@@ -40,7 +40,7 @@ def flatten_reply(reply):
     return nodes
 
 
-class Inspect(object):
+class Inspect:
     app = None
 
     def __init__(self, destination=None, timeout=1, callback=None,
@@ -121,7 +121,7 @@ class Inspect(object):
         return self._request('objgraph', num=n, max_depth=max_depth, type=type)
 
 
-class Control(object):
+class Control:
     Mailbox = Mailbox
 
     def __init__(self, app=None):

+ 1 - 1
celery/app/defaults.py

@@ -52,7 +52,7 @@ def old_ns(ns):
 
 
 @python_2_unicode_compatible
-class Option(object):
+class Option:
     alt = None
     deprecate_by = None
     remove_by = None

+ 1 - 1
celery/app/log.py

@@ -47,7 +47,7 @@ class TaskFormatter(ColorFormatter):
         return ColorFormatter.format(self, record)
 
 
-class Logging(object):
+class Logging:
     #: The logging subsystem is only configured once per process.
     #: setup_logging_subsystem sets this flag, and subsequent calls
     #: will do nothing.

+ 2 - 2
celery/app/routes.py

@@ -26,7 +26,7 @@ def glob_to_re(glob, quote=string.punctuation.replace('*', '')):
     return glob.replace('*', '.+?')
 
 
-class MapRoute(object):
+class MapRoute:
     """Creates a router out of a :class:`dict`."""
 
     def __init__(self, map):
@@ -56,7 +56,7 @@ class MapRoute(object):
                     return {'queue': route}
 
 
-class Router(object):
+class Router:
 
     def __init__(self, routes=None, queues=None,
                  create_missing=False, app=None):

+ 2 - 2
celery/app/task.py

@@ -60,7 +60,7 @@ def _reprtask(task, fmt=None, flags=None):
 
 
 @python_2_unicode_compatible
-class Context(object):
+class Context:
     logfile = None
     loglevel = None
     hostname = None
@@ -136,7 +136,7 @@ class Context(object):
 
 @abstract.CallableTask.register
 @python_2_unicode_compatible
-class Task(object):
+class Task:
     """Task base class.
 
     When called tasks apply the :meth:`run` method.  This method must

+ 1 - 1
celery/app/trace.py

@@ -133,7 +133,7 @@ def get_log_policy(task, einfo, exc):
         return log_policy_unexpected
 
 
-class TraceInfo(object):
+class TraceInfo:
     __slots__ = ('state', 'retval')
 
     def __init__(self, state, retval=None):

+ 1 - 1
celery/app/utils.py

@@ -232,7 +232,7 @@ def detect_settings(conf, preconf={}, ignore_keys=set(), prefix=None,
     return Settings(preconf, [conf, defaults], info.key_t, prefix=prefix)
 
 
-class AppPickler(object):
+class AppPickler:
     """Old application pickler/unpickler (< 3.1)."""
 
     def __call__(self, cls, *args):

+ 2 - 2
celery/apps/beat.py

@@ -35,9 +35,9 @@ Configuration ->
 logger = get_logger('celery.beat')
 
 
-class Beat(object):
-
+class Beat:
     Service = beat.Service
+
     app = None
 
     def __init__(self, max_interval=None, app=None,

+ 3 - 3
celery/backends/async.py

@@ -26,7 +26,7 @@ def register_drainer(name):
 
 
 @register_drainer('default')
-class Drainer(object):
+class Drainer:
 
     def __init__(self, result_consumer):
         self.result_consumer = result_consumer
@@ -97,7 +97,7 @@ class geventDrainer(greenletDrainer):
         return spawn
 
 
-class AsyncBackendMixin(object):
+class AsyncBackendMixin:
 
     def _collect_into(self, result, bucket):
         self.result_consumer.buckets[result] = bucket
@@ -176,7 +176,7 @@ class AsyncBackendMixin(object):
         return True
 
 
-class BaseResultConsumer(object):
+class BaseResultConsumer:
 
     def __init__(self, backend, app, accept,
                  pending_results, pending_messages):

+ 2 - 2
celery/backends/base.py

@@ -66,7 +66,7 @@ class _nulldict(dict):
     __setitem__ = update = setdefault = ignore
 
 
-class Backend(object):
+class Backend:
 
     READY_STATES = states.READY_STATES
     UNREADY_STATES = states.UNREADY_STATES
@@ -404,7 +404,7 @@ class Backend(object):
         return (unpickle_backend, (self.__class__, args, kwargs))
 
 
-class SyncBackendMixin(object):
+class SyncBackendMixin:
 
     def iter_native(self, result, timeout=None, interval=0.5, no_ack=True,
                     on_message=None, on_interval=None):

+ 1 - 1
celery/backends/cache.py

@@ -57,7 +57,7 @@ def get_best_memcache(*args, **kwargs):
     return Client, key_t
 
 
-class DummyClient(object):
+class DummyClient:
 
     def __init__(self, *args, **kwargs):
         self.cache = LRUCache(limit=5000)

+ 1 - 1
celery/backends/database/session.py

@@ -18,7 +18,7 @@ def _after_fork_cleanup_session(session):
     session._after_fork()
 
 
-class SessionManager(object):
+class SessionManager:
 
     def __init__(self):
         self._engines = {}

+ 3 - 3
celery/beat.py

@@ -51,7 +51,7 @@ class SchedulingError(Exception):
 
 @total_ordering
 @python_2_unicode_compatible
-class ScheduleEntry(object):
+class ScheduleEntry:
     """An entry in the scheduler.
 
     Arguments:
@@ -156,7 +156,7 @@ class ScheduleEntry(object):
         return NotImplemented
 
 
-class Scheduler(object):
+class Scheduler:
     """Scheduler for periodic tasks.
 
     The :program:`celery beat` program may instantiate this class
@@ -493,7 +493,7 @@ class PersistentScheduler(Scheduler):
         return '    . db -> {self.schedule_filename}'.format(self=self)
 
 
-class Service(object):
+class Service:
     scheduler_cls = PersistentScheduler
 
     def __init__(self, app, max_interval=None, schedule_filename=None,

+ 2 - 2
celery/bin/amqp.py

@@ -39,7 +39,7 @@ Example:
 say = partial(print, file=sys.stderr)
 
 
-class Spec(object):
+class Spec:
     """AMQP Command specification.
 
     Used to convert arguments to Python values and display various help
@@ -306,7 +306,7 @@ class AMQShell(cmd.Cmd):
         return self.prompt_fmt.format(self=self)
 
 
-class AMQPAdmin(object):
+class AMQPAdmin:
     """The celery :program:`celery amqp` utility."""
 
     Shell = AMQShell

+ 2 - 2
celery/bin/base.py

@@ -70,7 +70,7 @@ class UsageError(Error):
     status = EX_USAGE
 
 
-class Extensions(object):
+class Extensions:
 
     def __init__(self, namespace, register):
         self.names = []
@@ -111,7 +111,7 @@ class HelpFormatter(IndentedHelpFormatter):
             text.fill_paragraphs(text.dedent(description), self.width))
 
 
-class Command(object):
+class Command:
     """Base class for command-line applications.
 
     Arguments:

+ 1 - 1
celery/bin/celeryd_detach.py

@@ -106,7 +106,7 @@ class PartialOptionParser(OptionParser):
                 self.leftovers.append(rargs.pop(0))
 
 
-class detached_celeryd(object):
+class detached_celeryd:
     usage = '%prog [options] [celeryd options]'
     version = celery.VERSION_BANNER
     description = ('Detaches Celery worker nodes.  See `celery worker --help` '

+ 1 - 1
celery/bin/graph.py

@@ -56,7 +56,7 @@ class graph(Command):
                                          node._label.split('://')[0])
 
         @python_2_unicode_compatible
-        class Node(object):
+        class Node:
             force_label = None
             scheme = {}
 

+ 1 - 1
celery/bin/logtool.py

@@ -48,7 +48,7 @@ def task_info(line):
     return m.groups()
 
 
-class Audit(object):
+class Audit:
 
     def __init__(self, on_task_error=None, on_trace=None, on_debug=None):
         self.ids = set()

+ 2 - 2
celery/bin/multi.py

@@ -158,7 +158,7 @@ def celery_exe(*args):
     return ' '.join((CELERY_EXE,) + args)
 
 
-class MultiTool(object):
+class MultiTool:
     retcode = 0  # Final exit code.
 
     def __init__(self, env=None, fh=None, quiet=False, verbose=False,
@@ -545,7 +545,7 @@ def _get_nodename(name, prefix, suffix, options):
         return name, nodename, expand
 
 
-class NamespacedOptionParser(object):
+class NamespacedOptionParser:
 
     def __init__(self, args):
         self.args = args

+ 2 - 2
celery/bootsteps.py

@@ -74,7 +74,7 @@ class StepFormatter(GraphFormatter):
         return self.draw_edge(a, b, self.edge_scheme, attrs)
 
 
-class Blueprint(object):
+class Blueprint:
     """Blueprint containing bootsteps that can be applied to objects.
 
     Arguments:
@@ -292,7 +292,7 @@ class StepType(type):
 
 
 @with_metaclass(StepType)
-class Step(object):
+class Step:
     """A Bootstep.
 
     The :meth:`__init__` method is called when the step

+ 1 - 1
celery/canvas.py

@@ -39,7 +39,7 @@ PY3 = sys.version_info[0] == 3
 JSON_NEEDS_UNICODE_KEYS = PY3 and not try_import('simplejson')
 
 
-class _getitem_property(object):
+class _getitem_property:
     """Attribute -> dict key descriptor.
 
     The target object must support ``__getitem__``,

+ 1 - 1
celery/concurrency/base.py

@@ -44,7 +44,7 @@ def apply_target(target, args=(), kwargs={}, callback=None,
         callback(ret)
 
 
-class BasePool(object):
+class BasePool:
     RUN = 0x1
     CLOSE = 0x2
     TERMINATE = 0x3

+ 1 - 1
celery/contrib/migrate.py

@@ -33,7 +33,7 @@ class StopFiltering(Exception):
 
 
 @python_2_unicode_compatible
-class State(object):
+class State:
     count = 0
     filtered = 0
     total_apx = 0

+ 2 - 2
celery/events/__init__.py

@@ -72,7 +72,7 @@ def group_from(type):
     return type.split('-', 1)[0]
 
 
-class EventDispatcher(object):
+class EventDispatcher:
     """Dispatches event messages.
 
     Arguments:
@@ -405,7 +405,7 @@ class EventReceiver(ConsumerMixin):
         return self.channel.connection.client if self.channel else None
 
 
-class Events(object):
+class Events:
 
     def __init__(self, app=None):
         self.app = app

+ 1 - 1
celery/events/cursesmon.py

@@ -36,7 +36,7 @@ events: {s.event_count} tasks:{s.task_count} workers:{w_alive}/{w_all}
 """
 
 
-class CursesMonitor(object):  # pragma: no cover
+class CursesMonitor:  # pragma: no cover
     keymap = {}
     win = None
     screen_width = None

+ 1 - 1
celery/events/dumper.py

@@ -37,7 +37,7 @@ def humanize_type(type):
         return type.lower().replace('-', ' ')
 
 
-class Dumper(object):
+class Dumper:
 
     def __init__(self, out=sys.stdout):
         self.out = out

+ 1 - 1
celery/events/snapshot.py

@@ -24,7 +24,7 @@ __all__ = ['Polaroid', 'evcam']
 logger = get_logger('celery.evcam')
 
 
-class Polaroid(object):
+class Polaroid:
 
     timer = None
     shutter_signal = Signal(providing_args=('state',))

+ 3 - 3
celery/events/state.py

@@ -146,7 +146,7 @@ def with_unique_field(attr):
 
 @with_unique_field('hostname')
 @python_2_unicode_compatible
-class Worker(object):
+class Worker:
     """Worker State."""
     heartbeat_max = 4
     expire_window = HEARTBEAT_EXPIRE_WINDOW
@@ -239,7 +239,7 @@ class Worker(object):
 
 @with_unique_field('uuid')
 @python_2_unicode_compatible
-class Task(object):
+class Task:
     """Task State."""
     name = received = sent = started = succeeded = failed = retried = \
         revoked = rejected = args = kwargs = eta = expires = retries = \
@@ -374,7 +374,7 @@ class Task(object):
         return self.root_id and self.cluster_state.tasks[self.root_id]
 
 
-class State(object):
+class State:
     """Records clusters state."""
     Worker = Worker
     Task = Task

+ 1 - 1
celery/five.py

@@ -104,7 +104,7 @@ COMPAT_MODULES = {
 }
 
 
-class class_property(object):
+class class_property:
 
     def __init__(self, getter=None, setter=None):
         if getter is not None and not isinstance(getter, classmethod):

+ 2 - 2
celery/fixups/django.py

@@ -47,7 +47,7 @@ def fixup(app, env='DJANGO_SETTINGS_MODULE'):
             return DjangoFixup(app).install()
 
 
-class DjangoFixup(object):
+class DjangoFixup:
 
     def __init__(self, app):
         self.app = app
@@ -102,7 +102,7 @@ class DjangoFixup(object):
             return datetime.now
 
 
-class DjangoWorkerFixup(object):
+class DjangoWorkerFixup:
     _db_recycles = 0
 
     def __init__(self, app):

+ 1 - 1
celery/loaders/base.py

@@ -36,7 +36,7 @@ Did you mean '{suggest}'?
 unconfigured = object()
 
 
-class BaseLoader(object):
+class BaseLoader:
     """The base class for loaders.
 
     Loaders handles,

+ 1 - 1
celery/local.py

@@ -49,7 +49,7 @@ def try_import(module, default=None):
         return default
 
 
-class Proxy(object):
+class Proxy:
     """Proxy to another object."""
 
     # Code stolen from werkzeug.local.Proxy.

+ 3 - 3
celery/platforms.py

@@ -115,7 +115,7 @@ class LockFailed(Exception):
     """Raised if a PID lock can't be acquired."""
 
 
-class Pidfile(object):
+class Pidfile:
     """Pidfile
 
     This is the type returned by :func:`create_pidlock`.
@@ -286,7 +286,7 @@ def fd_by_path(paths):
     return [_fd for _fd in range(get_fdmax(2048)) if fd_in_stats(_fd)]
 
 
-class DaemonContext(object):
+class DaemonContext:
 
     _is_open = False
 
@@ -551,7 +551,7 @@ def maybe_drop_privileges(uid=None, gid=None):
         raise AssertionError('Still root gid after drop privileges!')
 
 
-class Signals(object):
+class Signals:
     """Convenience interface to :mod:`signals`.
 
     If the requested signal is not supported on the current platform,

+ 1 - 1
celery/result.py

@@ -54,7 +54,7 @@ def allow_join_result():
         _set_task_join_will_block(reset_value)
 
 
-class ResultBase(object):
+class ResultBase:
     """Base class for all results"""
 
     #: Parent result (if part of a chain)

+ 2 - 2
celery/schedules.py

@@ -63,7 +63,7 @@ class ParseException(Exception):
 
 
 @python_2_unicode_compatible
-class schedule(object):
+class schedule:
     """Schedule for periodic task.
 
     Arguments:
@@ -173,7 +173,7 @@ class schedule(object):
         return dt
 
 
-class crontab_parser(object):
+class crontab_parser:
     """Parser for Crontab expressions. Any expression of the form 'groups'
     (see BNF grammar below) is accepted and expanded to a set of numbers.
     These numbers represent the units of time that the Crontab needs to

+ 2 - 2
celery/security/certificate.py

@@ -15,7 +15,7 @@ from .utils import crypto, reraise_errors
 __all__ = ['Certificate', 'CertStore', 'FSCertStore']
 
 
-class Certificate(object):
+class Certificate:
     """X.509 certificate."""
 
     def __init__(self, cert):
@@ -46,7 +46,7 @@ class Certificate(object):
             crypto.verify(self._cert, signature, data, digest)
 
 
-class CertStore(object):
+class CertStore:
     """Base class for certificate stores"""
 
     def __init__(self):

+ 1 - 1
celery/security/key.py

@@ -9,7 +9,7 @@ from .utils import crypto, reraise_errors
 __all__ = ['PrivateKey']
 
 
-class PrivateKey(object):
+class PrivateKey:
 
     def __init__(self, key):
         with reraise_errors('Invalid private key: {0!r}'):

+ 1 - 1
celery/security/serialization.py

@@ -18,7 +18,7 @@ __all__ = ['SecureSerializer', 'register_auth']
 PY3 = sys.version_info[0] == 3
 
 
-class SecureSerializer(object):
+class SecureSerializer:
 
     def __init__(self, key=None, cert=None, cert_store=None,
                  digest='sha1', serializer='json'):

+ 1 - 1
celery/task/base.py

@@ -31,7 +31,7 @@ _COMPAT_CLASSMETHODS = (
 
 
 @python_2_unicode_compatible
-class _CompatShared(object):
+class _CompatShared:
 
     def __init__(self, name, cons):
         self.name = name

+ 1 - 1
celery/tests/app/test_annotations.py

@@ -6,7 +6,7 @@ from celery.utils.imports import qualname
 from celery.tests.case import AppCase
 
 
-class MyAnnotation(object):
+class MyAnnotation:
     foo = 65
 
 

+ 9 - 9
celery/tests/app/test_app.py

@@ -37,7 +37,7 @@ from celery.utils.objects import Bunch
 THIS_IS_A_KEY = 'this is a value'
 
 
-class ObjectConfig(object):
+class ObjectConfig:
     FOO = 1
     BAR = 2
 
@@ -45,7 +45,7 @@ object_config = ObjectConfig()
 dict_config = dict(FOO=10, BAR=20)
 
 
-class ObjectConfig2(object):
+class ObjectConfig2:
     LEAVE_FOR_WORK = True
     MOMENT_TO_STOP = True
     CALL_ME_BACK = 123456789
@@ -542,7 +542,7 @@ class test_App(AppCase):
 
     def test_config_from_object__compat(self):
 
-        class Config(object):
+        class Config:
             CELERY_ALWAYS_EAGER = 44
             CELERY_DEFAULT_DELIVERY_MODE = 30
             CELERY_TASK_PUBLISH_RETRY = False
@@ -555,7 +555,7 @@ class test_App(AppCase):
 
     def test_config_from_object__supports_old_names(self):
 
-        class Config(object):
+        class Config:
             task_always_eager = 45
             task_default_delivery_mode = 301
 
@@ -568,7 +568,7 @@ class test_App(AppCase):
 
     def test_config_from_object__namespace_uppercase(self):
 
-        class Config(object):
+        class Config:
             CELERY_TASK_ALWAYS_EAGER = 44
             CELERY_TASK_DEFAULT_DELIVERY_MODE = 301
 
@@ -577,7 +577,7 @@ class test_App(AppCase):
 
     def test_config_from_object__namespace_lowercase(self):
 
-        class Config(object):
+        class Config:
             celery_task_always_eager = 44
             celery_task_default_delivery_mode = 301
 
@@ -586,7 +586,7 @@ class test_App(AppCase):
 
     def test_config_from_object__mixing_new_and_old(self):
 
-        class Config(object):
+        class Config:
             task_always_eager = 44
             worker_agent = 'foo:Agent'
             worker_consumer = 'foo:Consumer'
@@ -601,7 +601,7 @@ class test_App(AppCase):
 
     def test_config_from_object__mixing_old_and_new(self):
 
-        class Config(object):
+        class Config:
             CELERY_ALWAYS_EAGER = 46
             CELERYD_AGENT = 'foo:Agent'
             CELERYD_CONSUMER = 'foo:Consumer'
@@ -851,7 +851,7 @@ class test_App(AppCase):
 
     def test_send_task_sent_event(self):
 
-        class Dispatcher(object):
+        class Dispatcher:
             sent = []
 
             def publish(self, type, fields, *args, **kwargs):

+ 2 - 2
celery/tests/app/test_beat.py

@@ -25,7 +25,7 @@ class MockShelve(dict):
         self.synced = True
 
 
-class MockService(object):
+class MockService:
     started = False
     stopped = False
 
@@ -494,7 +494,7 @@ class test_EmbeddedService(AppCase):
         self.assertIsInstance(s.service, beat.Service)
         s.service = MockService()
 
-        class _Popen(object):
+        class _Popen:
             terminated = False
 
             def terminate(self):

+ 2 - 2
celery/tests/app/test_log.py

@@ -29,7 +29,7 @@ from celery.tests.case import AppCase, Mock, mock, patch, skip
 class test_TaskFormatter(AppCase):
 
     def test_no_task(self):
-        class Record(object):
+        class Record:
             msg = 'hello world'
             levelname = 'info'
             exc_text = exc_info = None
@@ -136,7 +136,7 @@ class test_ColorFormatter(AppCase):
         safe_str.side_effect = on_safe_str
 
         @python_2_unicode_compatible
-        class Record(object):
+        class Record:
             levelname = 'ERROR'
             msg = 'HELLO'
             exc_info = 1

+ 3 - 3
celery/tests/backends/test_amqp.py

@@ -17,7 +17,7 @@ from celery.result import AsyncResult
 from celery.tests.case import AppCase, Mock, depends_on_current_app, mock
 
 
-class SomeClass(object):
+class SomeClass:
 
     def __init__(self, data):
         self.data = data
@@ -146,7 +146,7 @@ class test_AMQPBackend(AppCase):
     def _result_context(self):
         results = Queue()
 
-        class Message(object):
+        class Message:
             acked = 0
             requeued = 0
 
@@ -164,7 +164,7 @@ class test_AMQPBackend(AppCase):
             def requeue(self, *args, **kwargs):
                 self.requeued += 1
 
-        class MockBinding(object):
+        class MockBinding:
 
             def __init__(self, *args, **kwargs):
                 self.channel = Mock()

+ 1 - 1
celery/tests/backends/test_base.py

@@ -27,7 +27,7 @@ from celery.utils.functional import pass1
 from celery.tests.case import ANY, AppCase, Case, Mock, call, patch, skip
 
 
-class wrapobject(object):
+class wrapobject:
 
     def __init__(self, *args, **kwargs):
         self.args = args

+ 2 - 2
celery/tests/backends/test_cache.py

@@ -18,7 +18,7 @@ from celery.tests.case import AppCase, Mock, mock, patch, skip
 PY3 = sys.version_info[0] == 3
 
 
-class SomeClass(object):
+class SomeClass:
 
     def __init__(self, data):
         self.data = data
@@ -162,7 +162,7 @@ class MemcachedClient(DummyClient):
         return super(MemcachedClient, self).set(key, value, *args, **kwargs)
 
 
-class MockCacheMixin(object):
+class MockCacheMixin:
 
     @contextmanager
     def mock_memcache(self):

+ 3 - 3
celery/tests/backends/test_cassandra.py

@@ -104,7 +104,7 @@ class test_CassandraBackend(AppCase):
         class OTOExc(Exception):
             pass
 
-        class VeryFaultyCluster(object):
+        class VeryFaultyCluster:
             def __init__(self, *args, **kwargs):
                 pass
 
@@ -132,7 +132,7 @@ class test_CassandraBackend(AppCase):
         # Ensure that Cluster object IS shut down.
         from celery.backends import cassandra as mod
 
-        class RAMHoggingCluster(object):
+        class RAMHoggingCluster:
 
             objects_alive = 0
 
@@ -163,7 +163,7 @@ class test_CassandraBackend(AppCase):
         # ImproperlyConfigured exception.
         from celery.backends import cassandra as mod
 
-        class DummyAuth(object):
+        class DummyAuth:
             ValidAuthProvider = Mock()
 
         mod.cassandra = Mock()

+ 1 - 1
celery/tests/backends/test_database.py

@@ -26,7 +26,7 @@ else:
     from celery.backends.database.models import Task, TaskSet
 
 
-class SomeClass(object):
+class SomeClass:
 
     def __init__(self, data):
         self.data = data

+ 5 - 5
celery/tests/backends/test_redis.py

@@ -28,14 +28,14 @@ def raise_on_second_call(mock, exc, *retval):
         mock.return_value, = retval
 
 
-class Connection(object):
+class Connection:
     connected = True
 
     def disconnect(self):
         self.connected = False
 
 
-class Pipeline(object):
+class Pipeline:
 
     def __init__(self, client):
         self.client = client
@@ -108,15 +108,15 @@ class Redis(mock.MockCallbacks):
         return len(self.keyspace.get(key) or [])
 
 
-class redis(object):
+class redis:
     StrictRedis = Redis
 
-    class ConnectionPool(object):
+    class ConnectionPool:
 
         def __init__(self, **kwargs):
             pass
 
-    class UnixDomainSocketConnection(object):
+    class UnixDomainSocketConnection:
 
         def __init__(self, **kwargs):
             pass

+ 1 - 1
celery/tests/bin/test_base.py

@@ -16,7 +16,7 @@ from celery.tests.case import (
 )
 
 
-class MyApp(object):
+class MyApp:
     user_options = {'preload': None}
 
 APP = MyApp()  # <-- Used by test_with_custom_app

+ 1 - 1
celery/tests/bin/test_events.py

@@ -5,7 +5,7 @@ from celery.bin import events
 from celery.tests.case import AppCase, patch, _old_patch, skip
 
 
-class MockCommand(object):
+class MockCommand:
     executed = []
 
     def execute_from_commandline(self, **kwargs):

+ 1 - 1
celery/tests/bin/test_multi.py

@@ -300,7 +300,7 @@ class test_MultiTool(AppCase):
         self.assertEqual(sigs[2][0], ('c', 12, signal.SIGKILL))
 
     def prepare_pidfile_for_getpids(self, Pidfile):
-        class pids(object):
+        class pids:
 
             def __init__(self, path):
                 self.path = path

+ 3 - 3
celery/tests/bin/test_worker.py

@@ -323,7 +323,7 @@ class test_Worker(WorkerAppCase):
         def install_HUP_nosupport(controller):
             controller.hup_not_supported_installed = True
 
-        class Controller(object):
+        class Controller:
             pass
 
         prev = cd.install_HUP_not_supported_handler
@@ -345,7 +345,7 @@ class test_Worker(WorkerAppCase):
         def install_worker_restart_handler(worker):
             restart_worker_handler_installed[0] = True
 
-        class Controller(object):
+        class Controller:
             pass
 
         prev = cd.install_worker_restart_handler
@@ -418,7 +418,7 @@ class test_funs(WorkerAppCase):
 @mock.stdouts
 class test_signal_handlers(WorkerAppCase):
 
-    class _Worker(object):
+    class _Worker:
         stopped = False
         terminated = False
 

+ 2 - 2
celery/tests/case.py

@@ -85,7 +85,7 @@ class Case(_Case):
     PendingDeprecationWarning = CPendingDeprecationWarning
 
 
-class Trap(object):
+class Trap:
 
     def __getattr__(self, name):
         raise RuntimeError('Test depends on current_app')
@@ -162,7 +162,7 @@ class AppCase(Case):
         self._prev_tls = _state._tls
         _state.set_default_app(trap)
 
-        class NonTLS(object):
+        class NonTLS:
             current_app = trap
         _state._tls = NonTLS()
 

+ 5 - 5
celery/tests/concurrency/test_prefork.py

@@ -19,10 +19,10 @@ try:
     from celery.concurrency import asynpool
 except ImportError:
 
-    class _mp(object):
+    class _mp:
         RUN = 0x1
 
-        class TaskPool(object):
+        class TaskPool:
             _pool = Mock()
 
             def __init__(self, *args, **kwargs):
@@ -40,7 +40,7 @@ except ImportError:
     asynpool = None  # noqa
 
 
-class MockResult(object):
+class MockResult:
 
     def __init__(self, value, pid):
         self.value = value
@@ -111,7 +111,7 @@ class test_process_destructor(AppCase):
         )
 
 
-class MockPool(object):
+class MockPool:
     started = False
     closed = False
     joined = False
@@ -390,7 +390,7 @@ class test_TaskPool(PoolCase):
         pool = TaskPool(10)
         procs = [Bunch(pid=i) for i in range(pool.limit)]
 
-        class _Pool(object):
+        class _Pool:
             _pool = procs
             _maxtasksperchild = None
             timeout = 10

+ 1 - 1
celery/tests/events/test_cursesmon.py

@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 from celery.tests.case import AppCase, skip
 
 
-class MockWindow(object):
+class MockWindow:
 
     def getmaxyx(self):
         return self.y, self.x

+ 1 - 1
celery/tests/events/test_events.py

@@ -7,7 +7,7 @@ from celery.events import CLIENT_CLOCK_SKEW, Event
 from celery.tests.case import AppCase, Mock, call
 
 
-class MockProducer(object):
+class MockProducer:
 
     raise_on_publish = False
 

+ 2 - 2
celery/tests/events/test_snapshot.py

@@ -6,7 +6,7 @@ from celery.events.snapshot import Polaroid, evcam
 from celery.tests.case import AppCase, Mock, mock, patch
 
 
-class MockTimer(object):
+class MockTimer:
     installed = []
 
     def call_repeatedly(self, secs, fun, *args, **kwargs):
@@ -87,7 +87,7 @@ class test_Polaroid(AppCase):
 
 class test_evcam(AppCase):
 
-    class MockReceiver(object):
+    class MockReceiver:
         raise_keyboard_interrupt = False
 
         def capture(self, **kwargs):

+ 1 - 1
celery/tests/events/test_state.py

@@ -31,7 +31,7 @@ else:
         return f
 
 
-class replay(object):
+class replay:
 
     def __init__(self, state):
         self.state = state

+ 3 - 2
celery/tests/utils/test_deprecated.py

@@ -10,7 +10,7 @@ class test_deprecated_property(Case):
     @patch('celery.utils.deprecated.warn')
     def test_deprecated(self, warn):
 
-        class X(object):
+        class X:
             _foo = None
 
             @deprecated.Property(deprecation='1.2')
@@ -48,7 +48,8 @@ class test_deprecated_property(Case):
         self.assertIsNone(x._foo)
 
     def test_deprecated_no_setter_or_deleter(self):
-        class X(object):
+
+        class X:
             @deprecated.Property(deprecation='1.2')
             def foo(self):
                 pass

+ 1 - 1
celery/tests/utils/test_dispatcher.py

@@ -34,7 +34,7 @@ def receiver_1_arg(val, **kwargs):
     return val
 
 
-class Callable(object):
+class Callable:
 
     def __call__(self, val, **kwargs):
         return val

+ 1 - 1
celery/tests/utils/test_encoding.py

@@ -13,7 +13,7 @@ class test_encoding(Case):
     def test_safe_repr(self):
         self.assertTrue(encoding.safe_repr(object()))
 
-        class foo(object):
+        class foo:
             def __repr__(self):
                 raise ValueError('foo')
 

+ 2 - 2
celery/tests/utils/test_functional.py

@@ -49,7 +49,7 @@ class test_utils(Case):
 
     def test_firstmethod_handles_lazy(self):
 
-        class A(object):
+        class A:
 
             def __init__(self, value=None):
                 self.value = value
@@ -147,7 +147,7 @@ class test_regen(Case):
 class test_head_from_fun(Case):
 
     def test_from_cls(self):
-        class X(object):
+        class X:
             def __call__(x, y, kwarg=1):
                 pass
 

+ 14 - 14
celery/tests/utils/test_local.py

@@ -63,7 +63,7 @@ class test_Proxy(Case):
 
     def test_bool(self):
 
-        class X(object):
+        class X:
 
             def __bool__(self):
                 return False
@@ -74,7 +74,7 @@ class test_Proxy(Case):
 
     def test_slots(self):
 
-        class X(object):
+        class X:
             __slots__ = ()
 
         x = Proxy(X)
@@ -85,7 +85,7 @@ class test_Proxy(Case):
     def test_unicode(self):
 
         @python_2_unicode_compatible
-        class X(object):
+        class X:
 
             def __unicode__(self):
                 return 'UNICODE'
@@ -102,7 +102,7 @@ class test_Proxy(Case):
 
     def test_dir(self):
 
-        class X(object):
+        class X:
 
             def __dir__(self):
                 return ['a', 'b', 'c']
@@ -110,7 +110,7 @@ class test_Proxy(Case):
         x = Proxy(lambda: X())
         self.assertListEqual(dir(x), ['a', 'b', 'c'])
 
-        class Y(object):
+        class Y:
 
             def __dir__(self):
                 raise RuntimeError()
@@ -119,7 +119,7 @@ class test_Proxy(Case):
 
     def test_getsetdel_attr(self):
 
-        class X(object):
+        class X:
             a = 1
             b = 2
             c = 3
@@ -175,7 +175,7 @@ class test_Proxy(Case):
 
     def test_complex_cast(self):
 
-        class O(object):
+        class O:
 
             def __complex__(self):
                 return complex(10.333)
@@ -185,7 +185,7 @@ class test_Proxy(Case):
 
     def test_index(self):
 
-        class O(object):
+        class O:
 
             def __index__(self):
                 return 1
@@ -195,7 +195,7 @@ class test_Proxy(Case):
 
     def test_coerce(self):
 
-        class O(object):
+        class O:
 
             def __coerce__(self, other):
                 return self, other
@@ -275,7 +275,7 @@ class test_Proxy(Case):
 
     def test_hash(self):
 
-        class X(object):
+        class X:
 
             def __hash__(self):
                 return 1234
@@ -284,7 +284,7 @@ class test_Proxy(Case):
 
     def test_call(self):
 
-        class X(object):
+        class X:
 
             def __call__(self):
                 return 1234
@@ -293,7 +293,7 @@ class test_Proxy(Case):
 
     def test_context(self):
 
-        class X(object):
+        class X:
             entered = exited = False
 
             def __enter__(self):
@@ -312,7 +312,7 @@ class test_Proxy(Case):
 
     def test_reduce(self):
 
-        class X(object):
+        class X:
 
             def __reduce__(self):
                 return 123
@@ -325,7 +325,7 @@ class test_PromiseProxy(Case):
 
     def test_only_evaluated_once(self):
 
-        class X(object):
+        class X:
             attr = 123
             evals = 0
 

+ 7 - 5
celery/tests/utils/test_platforms.py

@@ -237,7 +237,7 @@ class test_maybe_drop_privileges(Case):
         geteuid.return_value = 10
         getuid.return_value = 10
 
-        class pw_struct(object):
+        class pw_struct:
             pw_gid = 50001
 
         def raise_on_second_call(*args, **kwargs):
@@ -353,7 +353,7 @@ class test_setget_uid_gid(Case):
     @patch('pwd.getpwnam')
     def test_parse_uid_when_existing_name(self, getpwnam):
 
-        class pwent(object):
+        class pwent:
             pw_uid = 5001
 
         getpwnam.return_value = pwent()
@@ -372,7 +372,7 @@ class test_setget_uid_gid(Case):
     @patch('grp.getgrnam')
     def test_parse_gid_when_existing_name(self, getgrnam):
 
-        class grent(object):
+        class grent:
             gr_gid = 50001
 
         getgrnam.return_value = grent()
@@ -408,7 +408,7 @@ class test_initgroups(Case):
         try:
             getpwuid.return_value = ['user']
 
-            class grent(object):
+            class grent:
                 gr_mem = ['user']
 
                 def __init__(self, gid):
@@ -830,8 +830,10 @@ class test_setgroups(Case):
 class test_check_privileges(Case):
 
     def test_suspicious(self):
-        class Obj(object):
+
+        class Obj:
             fchown = 13
+
         prev, platforms.os = platforms.os, Obj()
         try:
             with self.assertRaises(AssertionError):

+ 2 - 2
celery/tests/utils/test_saferef.py

@@ -5,7 +5,7 @@ from celery.utils.dispatch.saferef import safe_ref
 from celery.tests.case import Case
 
 
-class Class1(object):
+class Class1:
 
     def x(self):
         pass
@@ -15,7 +15,7 @@ def fun(obj):
     pass
 
 
-class Class2(object):
+class Class2:
 
     def __call__(self, obj):
         pass

+ 4 - 4
celery/tests/worker/test_control.py

@@ -25,7 +25,7 @@ from celery.tests.case import AppCase, Mock, TaskMessage, call, patch
 hostname = socket.gethostname()
 
 
-class WorkController(object):
+class WorkController:
 
     def stats(self):
         return {'total': worker_state.total_count}
@@ -303,7 +303,7 @@ class test_ControlPanel(AppCase):
 
     def test_pool_grow(self):
 
-        class MockPool(object):
+        class MockPool:
 
             def __init__(self, size=1):
                 self.size = size
@@ -338,7 +338,7 @@ class test_ControlPanel(AppCase):
 
     def test_add__cancel_consumer(self):
 
-        class MockConsumer(object):
+        class MockConsumer:
             queues = []
             canceled = []
             consuming = False
@@ -417,7 +417,7 @@ class test_ControlPanel(AppCase):
 
     def test_rate_limit(self):
 
-        class xConsumer(object):
+        class xConsumer:
             reset = False
 
             def reset_rate_limits(self):

+ 2 - 2
celery/tests/worker/test_heartbeat.py

@@ -4,7 +4,7 @@ from celery.worker.heartbeat import Heart
 from celery.tests.case import AppCase, Mock
 
 
-class MockDispatcher(object):
+class MockDispatcher:
     heart = None
     next_iter = 0
 
@@ -22,7 +22,7 @@ class MockDispatcher(object):
             self.next_iter += 1
 
 
-class MockTimer(object):
+class MockTimer:
 
     def call_repeatedly(self, secs, fun, args=(), kwargs={}):
 

+ 2 - 2
celery/tests/worker/test_loops.py

@@ -19,7 +19,7 @@ from celery.tests.case import AppCase, Mock, task_message_from_sig
 
 
 @python_2_unicode_compatible
-class PromiseEqual(object):
+class PromiseEqual:
 
     def __init__(self, fun, *args, **kwargs):
         self.fun = fun
@@ -35,7 +35,7 @@ class PromiseEqual(object):
         return '<promise: {0.fun!r} {0.args!r} {0.kwargs!r}>'.format(self)
 
 
-class X(object):
+class X:
 
     def __init__(self, app, heartbeat=None, on_task_message=None,
                  transport_driver_type=None):

+ 1 - 1
celery/tests/worker/test_request.py

@@ -89,7 +89,7 @@ class test_mro_lookup(Case):
 
     def test_order(self):
 
-        class A(object):
+        class A:
             pass
 
         class B(A):

+ 1 - 1
celery/tests/worker/test_state.py

@@ -161,7 +161,7 @@ class test_Persistent(StateResetCase):
             self.assertIn(item, saved)
 
 
-class SimpleReq(object):
+class SimpleReq:
 
     def __init__(self, name):
         self.id = uuid()

+ 1 - 1
celery/tests/worker/test_strategy.py

@@ -70,7 +70,7 @@ class test_default_strategy_proto2(AppCase):
     def prepare_message(self, message):
         return message
 
-    class Context(object):
+    class Context:
 
         def __init__(self, sig, s, reserved, consumer, message):
             self.sig = sig

+ 2 - 2
celery/tests/worker/test_worker.py

@@ -573,7 +573,7 @@ class test_Consumer(AppCase):
         controller.box.node.listen = BConsumer()
         connections = []
 
-        class Connection(object):
+        class Connection:
             calls = 0
 
             def __init__(self, obj):
@@ -634,7 +634,7 @@ class test_Consumer(AppCase):
 
     def test_start__loop(self):
 
-        class _QoS(object):
+        class _QoS:
             prev = 3
             value = 4
 

+ 1 - 1
celery/utils/abstract.py

@@ -15,7 +15,7 @@ def _hasattr(C, attr):
 
 
 @with_metaclass(ABCMeta)
-class _AbstractClass(object):
+class _AbstractClass:
     __required_attributes__ = frozenset()
 
     @classmethod

+ 5 - 5
celery/utils/collections.py

@@ -26,7 +26,7 @@ except ImportError:
 try:
     from django.utils.functional import LazyObject, LazySettings
 except ImportError:
-    class LazyObject(object):  # noqa
+    class LazyObject:  # noqa
         pass
     LazySettings = LazyObject  # noqa
 
@@ -108,7 +108,7 @@ class OrderedDict(_OrderedDict):
                     root[1] = first[0] = link
 
 
-class AttributeDictMixin(object):
+class AttributeDictMixin:
     """Augment classes with a Mapping interface by adding attribute access.
 
     I.e. `d.key -> d[key]`.
@@ -133,7 +133,7 @@ class AttributeDict(dict, AttributeDictMixin):
     pass
 
 
-class DictAttribute(object):
+class DictAttribute:
     """Dict interface to attributes.
 
     `obj[k] -> obj.k`
@@ -417,7 +417,7 @@ class ConfigurationView(ChainMap, AttributeDictMixin):
 
 
 @python_2_unicode_compatible
-class LimitedSet(object):
+class LimitedSet:
     """Kind-of Set (or priority queue) with limitations.
 
     Good for when you need to test for membership (`a in set`),
@@ -633,7 +633,7 @@ class LimitedSet(object):
 MutableSet.register(LimitedSet)
 
 
-class Evictable(object):
+class Evictable:
 
     Empty = Empty
 

+ 1 - 1
celery/utils/deprecated.py

@@ -73,7 +73,7 @@ def Property(deprecation=None, removal=None,
     return _inner
 
 
-class _deprecated_property(object):
+class _deprecated_property:
 
     def __init__(self, fget=None, fset=None, fdel=None, doc=None, **depreinfo):
         self.__get = fget

+ 1 - 1
celery/utils/dispatch/saferef.py

@@ -45,7 +45,7 @@ def safe_ref(target, on_delete=None):  # pragma: no cover
 
 
 @python_2_unicode_compatible
-class BoundMethodWeakref(object):  # pragma: no cover
+class BoundMethodWeakref:  # pragma: no cover
     """'Safe' and reusable weak references to instance methods.
 
     BoundMethodWeakref objects provide a mechanism for

+ 1 - 1
celery/utils/dispatch/signal.py

@@ -29,7 +29,7 @@ def _make_id(target):  # pragma: no cover
 
 
 @python_2_unicode_compatible
-class Signal(object):  # pragma: no cover
+class Signal:  # pragma: no cover
     """Observer pattern implementation.
 
     Arguments:

+ 1 - 1
celery/utils/functional.py

@@ -30,7 +30,7 @@ def {fun_name}({fun_args}):
 """
 
 
-class DummyContext(object):
+class DummyContext:
 
     def __enter__(self):
         return self

+ 2 - 2
celery/utils/graph.py

@@ -30,7 +30,7 @@ class CycleError(Exception):
 
 
 @python_2_unicode_compatible
-class DependencyGraph(object):
+class DependencyGraph:
     """A directed acyclic graph of objects and their dependencies.
 
     Supports a robust topological sort
@@ -224,7 +224,7 @@ class DependencyGraph(object):
         return '\n'.join(output)
 
 
-class GraphFormatter(object):
+class GraphFormatter:
     _attr = DOT.ATTR.strip()
     _node = DOT.NODE.strip()
     _edge = DOT.EDGE.strip()

+ 1 - 1
celery/utils/log.py

@@ -167,7 +167,7 @@ class ColorFormatter(logging.Formatter):
             return safe_str(msg)
 
 
-class LoggingProxy(object):
+class LoggingProxy:
     """Forward file object to :class:`logging.Logger` instance.
 
     Arguments:

+ 2 - 2
celery/utils/objects.py

@@ -5,7 +5,7 @@ from __future__ import absolute_import, unicode_literals
 __all__ = ['Bunch', 'FallbackContext', 'mro_lookup']
 
 
-class Bunch(object):
+class Bunch:
     """Object that enables you to modify attributes."""
 
     def __init__(self, **kwargs):
@@ -42,7 +42,7 @@ def mro_lookup(cls, attr, stop=set(), monkey_patched=[]):
             return node
 
 
-class FallbackContext(object):
+class FallbackContext:
     """The built-in ``@contextmanager`` utility does not work well
     when wrapping other contexts, as the traceback is wrong when
     the wrapped context raises.

+ 1 - 1
celery/utils/saferepr.py

@@ -35,7 +35,7 @@ IS_PY3 = sys.version_info[0] == 3
 if IS_PY3:  # pragma: no cover
     range_t = (range, )
 else:
-    class range_t(object):  # noqa
+    class range_t:  # noqa
         pass
 
 _literal = namedtuple('_literal', ('value', 'truncate', 'direction'))

+ 1 - 1
celery/utils/sysinfo.py

@@ -22,7 +22,7 @@ else:  # pragma: no cover
         return (0.0, 0.0, 0.0)
 
 
-class df(object):
+class df:
 
     def __init__(self, path):
         self.path = path

+ 1 - 1
celery/utils/term.py

@@ -23,7 +23,7 @@ def fg(s):
 
 
 @python_2_unicode_compatible
-class colored(object):
+class colored:
     """Terminal colored text.
 
     Example:

+ 3 - 3
celery/utils/threads.py

@@ -113,7 +113,7 @@ def release_local(local):
     local.__release_local__()
 
 
-class Local(object):
+class Local:
     __slots__ = ('__storage__', '__ident_func__')
 
     def __init__(self):
@@ -151,7 +151,7 @@ class Local(object):
             raise AttributeError(name)
 
 
-class _LocalStack(object):
+class _LocalStack:
     """This class works similar to a :class:`Local` but keeps a stack
     of objects instead.  This is best explained with an example::
 
@@ -244,7 +244,7 @@ class _LocalStack(object):
 
 
 @python_2_unicode_compatible
-class LocalManager(object):
+class LocalManager:
     """Local objects cannot manage themselves. For that you need a local
     manager.  You can pass a local manager multiple locals or add them
     later by appending them to ``manager.locals``.  Every time the manager

+ 2 - 2
celery/utils/timeutils.py

@@ -111,7 +111,7 @@ class LocalTimezone(tzinfo):
         return tt.tm_isdst > 0
 
 
-class _Zone(object):
+class _Zone:
 
     def tz_or_local(self, tzinfo=None):
         if tzinfo is None:
@@ -324,7 +324,7 @@ def maybe_make_aware(dt, tz=None):
 
 
 @python_2_unicode_compatible
-class ffwd(object):
+class ffwd:
     """Version of ``dateutil.relativedelta`` that only supports addition."""
 
     def __init__(self, year=None, month=None, weeks=0, weekday=None, day=None,

+ 1 - 1
celery/worker/__init__.py

@@ -63,7 +63,7 @@ defined in the `task_queues` setting.
 
 
 @python_2_unicode_compatible
-class WorkController(object):
+class WorkController:
     """Unmanaged worker instance."""
 
     app = None

+ 1 - 1
celery/worker/consumer/consumer.py

@@ -118,7 +118,7 @@ def dump_body(m, body):
 
 
 @python_2_unicode_compatible
-class Consumer(object):
+class Consumer:
 
     Strategies = dict
 

+ 1 - 1
celery/worker/heartbeat.py

@@ -11,7 +11,7 @@ from .state import SOFTWARE_INFO, active_requests, all_total_count
 __all__ = ['Heart']
 
 
-class Heart(object):
+class Heart:
     """Timer sending heartbeats at regular intervals.
 
     Arguments:

+ 1 - 1
celery/worker/pidbox.py

@@ -19,7 +19,7 @@ logger = get_logger(__name__)
 debug, error, info = logger.debug, logger.error, logger.info
 
 
-class Pidbox(object):
+class Pidbox:
 
     consumer = None
 

+ 1 - 1
celery/worker/request.py

@@ -59,7 +59,7 @@ revoked_tasks = state.revoked
 
 
 @python_2_unicode_compatible
-class Request(object):
+class Request:
     """A request for task execution."""
     acknowledged = False
     time_start = None

+ 1 - 1
celery/worker/state.py

@@ -164,7 +164,7 @@ if C_BENCH:  # pragma: no cover
         return __ready(request)
 
 
-class Persistent(object):
+class Persistent:
     """This is the persistent data stored by the worker when
     :option:`celery worker --statedb` is enabled.
 

+ 1 - 1
docs/internals/app-overview.rst

@@ -176,7 +176,7 @@ is missing.
 
     from celery.app import app_or_default
 
-    class SomeClass(object):
+    class SomeClass:
 
         def __init__(self, app=None):
             self.app = app_or_default(app)

+ 6 - 6
docs/internals/guide.rst

@@ -53,10 +53,10 @@ Naming
             pass
 
         # - "action" class (verb)
-        class UpdateTwitterStatus(object):    # BAD
+        class UpdateTwitterStatus:    # BAD
             pass
 
-        class update_twitter_status(object):    # GOOD
+        class update_twitter_status:    # GOOD
             pass
 
     .. note::
@@ -71,7 +71,7 @@ Naming
 
     .. code-block:: python
 
-        class Celery(object):
+        class Celery:
 
             def consumer_factory(self):     # BAD
                 ...
@@ -89,7 +89,7 @@ as this means that they can be set by either instantiation or inheritance.
 
 .. code-block:: python
 
-    class Producer(object):
+    class Producer:
         active = True
         serializer = 'json'
 
@@ -130,7 +130,7 @@ the exception class from the instance directly.
     class Empty(Exception):
         pass
 
-    class Queue(object):
+    class Queue:
         Empty = Empty
 
         def get(self):
@@ -157,7 +157,7 @@ saved us from many a monkey patch).
 
 .. code-block:: python
 
-    class Worker(object):
+    class Worker:
         Consumer = Consumer
 
         def __init__(self, connection, consumer_cls=None):

+ 4 - 3
docs/userguide/application.rst

@@ -400,7 +400,7 @@ The following example is considered bad practice:
 
     from celery import current_app
 
-    class Scheduler(object):
+    class Scheduler:
 
         def run(self):
             app = current_app
@@ -409,7 +409,7 @@ Instead it should take the ``app`` as an argument:
 
 .. code-block:: python
 
-    class Scheduler(object):
+    class Scheduler:
 
         def __init__(self, app):
             self.app = app
@@ -421,7 +421,8 @@ so that everything also works in the module-based compatibility API
 
     from celery.app import app_or_default
 
-    class Scheduler(object):
+    class Scheduler:
+
         def __init__(self, app=None):
             self.app = app_or_default(app)
 

+ 3 - 3
docs/userguide/configuration.rst

@@ -261,7 +261,7 @@ instead of a dict to choose which tasks to annotate:
 
 .. code-block:: python
 
-    class MyAnnotate(object):
+    class MyAnnotate:
 
         def annotate(self, task):
             if task.name.startswith('tasks.'):
@@ -1281,8 +1281,8 @@ Where ``myapp.tasks.route_task`` could be:
 .. code-block:: python
 
     def route_task(self, name, args, kwargs, options, task=None, **kwargs):
-            if task == 'celery.ping':
-                return {'queue': 'default'}
+        if task == 'celery.ping':
+            return {'queue': 'default'}
 
 ``route_task`` may return a string or a dict. A string then means
 it's a queue name in :setting:`task_queues`, a dict means it's a custom route.

+ 4 - 5
docs/userguide/routing.rst

@@ -581,10 +581,10 @@ the signature ``(name, args, kwargs, options, task=None, **kwargs)``:
 .. code-block:: python
 
     def route_task(name, args, kwargs, options, task=None, **kwargs):
-            if name == 'myapp.tasks.compress_video':
-                return {'exchange': 'video',
-                        'exchange_type': 'topic',
-                        'routing_key': 'video.compress'}
+        if name == 'myapp.tasks.compress_video':
+            return {'exchange': 'video',
+                    'exchange_type': 'topic',
+                    'routing_key': 'video.compress'}
 
 If you return the ``queue`` key, it will expand with the defined settings of
 that queue in :setting:`task_queues`:
@@ -616,7 +616,6 @@ Router functions can also be added by name:
 
     task_routes = ('myapp.routers.route_task',)
 
-
 For simple task name -> route mappings like the router example above,
 you can simply drop a dict into :setting:`task_routes` to get the
 same behavior:

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio