Ask Solem 12 yıl önce
ebeveyn
işleme
7a27d8a505

+ 1 - 1
celery/datastructures.py

@@ -215,7 +215,7 @@ class AttributeDictMixin(object):
             return self[k]
             return self[k]
         except KeyError:
         except KeyError:
             raise AttributeError(
             raise AttributeError(
-                "{0!r} object has no attribute {1!r}".format(
+                '{0!r} object has no attribute {1!r}'.format(
                     type(self).__name__, k))
                     type(self).__name__, k))
 
 
     def __setattr__(self, key, value):
     def __setattr__(self, key, value):

+ 1 - 1
celery/tests/concurrency/test_eventlet.py

@@ -41,7 +41,7 @@ class EventletCase(Case):
 class test_aaa_eventlet_patch(EventletCase):
 class test_aaa_eventlet_patch(EventletCase):
 
 
     def test_aaa_is_patched(self):
     def test_aaa_is_patched(self):
-        raise SkipTest("side effects")
+        raise SkipTest('side effects')
         monkey_patched = []
         monkey_patched = []
         prev_monkey_patch = self.eventlet.monkey_patch
         prev_monkey_patch = self.eventlet.monkey_patch
         self.eventlet.monkey_patch = lambda: monkey_patched.append(True)
         self.eventlet.monkey_patch = lambda: monkey_patched.append(True)

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

@@ -23,12 +23,12 @@ def safe_ref(target, on_delete=None):  # pragma: no cover
         goes out of scope with the reference object, (either a
         goes out of scope with the reference object, (either a
         :class:`weakref.ref` or a :class:`BoundMethodWeakref`) as argument.
         :class:`weakref.ref` or a :class:`BoundMethodWeakref`) as argument.
     """
     """
-    if getattr(target, "im_self", None) is not None:
+    if getattr(target, 'im_self', None) is not None:
         # Turn a bound method into a BoundMethodWeakref instance.
         # Turn a bound method into a BoundMethodWeakref instance.
         # Keep track of these instances for lookup by disconnect().
         # Keep track of these instances for lookup by disconnect().
         assert hasattr(target, 'im_func'), \
         assert hasattr(target, 'im_func'), \
-            """safe_ref target {0!r} has im_self, but no im_func, " \
-            "don't know how to create reference""".format(target)
+            """safe_ref target {0!r} has im_self, but no im_func: \
+            don't know how to create reference""".format(target)
         return get_bound_method_weakref(target=target,
         return get_bound_method_weakref(target=target,
                                         on_delete=on_delete)
                                         on_delete=on_delete)
     if callable(on_delete):
     if callable(on_delete):
@@ -142,8 +142,8 @@ class BoundMethodWeakref(object):  # pragma: no cover
                     try:
                     try:
                         traceback.print_exc()
                         traceback.print_exc()
                     except AttributeError:
                     except AttributeError:
-                        print("Exception during saferef {0} cleanup function "
-                              "{1}: {2}".format(self, function, exc))
+                        print('Exception during saferef {0} cleanup function '
+                              '{1}: {2}'.format(self, function, exc))
 
 
         self.deletion_methods = [on_delete]
         self.deletion_methods = [on_delete]
         self.key = self.calculate_key(target)
         self.key = self.calculate_key(target)
@@ -163,7 +163,7 @@ class BoundMethodWeakref(object):  # pragma: no cover
 
 
     def __str__(self):
     def __str__(self):
         """Give a friendly representation of the object"""
         """Give a friendly representation of the object"""
-        return """{0}( {1}.{2} )""".format(
+        return '{0}( {1}.{2} )'.format(
             type(self).__name__,
             type(self).__name__,
             self.self_name,
             self.self_name,
             self.func_name,
             self.func_name,
@@ -212,7 +212,7 @@ class BoundNonDescriptorMethodWeakref(BoundMethodWeakref):  # pragma: no cover
         ...     pass
         ...     pass
 
 
         >>> def foo(self):
         >>> def foo(self):
-        ...     return "foo"
+        ...     return 'foo'
         >>> A.bar = foo
         >>> A.bar = foo
 
 
     But this shouldn't be a common use case. So, on platforms where methods
     But this shouldn't be a common use case. So, on platforms where methods

+ 2 - 3
celery/utils/timeutils.py

@@ -52,8 +52,7 @@ _local_timezone = None
 
 
 
 
 class LocalTimezone(tzinfo):
 class LocalTimezone(tzinfo):
-    """
-    Local time implementation taken from Python's docs.
+    """Local time implementation taken from Python's docs.
 
 
     Used only when pytz isn't available, and most likely inaccurate. If you're
     Used only when pytz isn't available, and most likely inaccurate. If you're
     having trouble with this class, don't waste your time, just install pytz.
     having trouble with this class, don't waste your time, just install pytz.
@@ -71,7 +70,7 @@ class LocalTimezone(tzinfo):
         tzinfo.__init__(self)
         tzinfo.__init__(self)
 
 
     def __repr__(self):
     def __repr__(self):
-        return "<LocalTimezone>"
+        return '<LocalTimezone>'
 
 
     def utcoffset(self, dt):
     def utcoffset(self, dt):
         if self._isdst(dt):
         if self._isdst(dt):