Browse Source

Import print_function in every module using print

Ask Solem 11 years ago
parent
commit
6ed09aaccf

+ 1 - 1
celery/__init__.py

@@ -5,7 +5,7 @@
 # :copyright: (c) 2012-2013 GoPivotal, Inc., All rights reserved.
 # :license:   BSD (3 Clause), see LICENSE for more details.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function, unicode_literals
 
 from collections import namedtuple
 

+ 1 - 1
celery/__main__.py

@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import sys
 

+ 1 - 1
celery/app/__init__.py

@@ -6,7 +6,7 @@
     Celery Application.
 
 """
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import os
 

+ 1 - 1
celery/apps/beat.py

@@ -10,7 +10,7 @@
     and so on.
 
 """
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_statement, unicode_literals
 
 import numbers
 import socket

+ 1 - 1
celery/events/snapshot.py

@@ -10,7 +10,7 @@
     in :mod:`djcelery.snapshots` in the `django-celery` distribution.
 
 """
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 from kombu.utils.limits import TokenBucket
 

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

@@ -805,7 +805,6 @@ class test_Request(AppCase):
             args=[4],
             kwargs={},
         )
-        print(job.execute())
         self.assertIsInstance(job.execute(), ExceptionInfo)
         meta = self.mytask_raising.backend.get_task_meta(tid)
         self.assertEqual(meta['status'], states.FAILURE)

+ 1 - 1
celery/utils/timer2.py

@@ -6,7 +6,7 @@
     Scheduler for Python functions.
 
 """
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import os
 import sys

+ 1 - 1
celery/utils/timeutils.py

@@ -6,7 +6,7 @@
     This module contains various utilities related to dates and times.
 
 """
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import numbers
 import os

+ 1 - 1
celery/worker/control.py

@@ -227,7 +227,7 @@ def objgraph(state, num=200, max_depth=10, type='Request'):  # pragma: no cover
         import objgraph
     except ImportError:
         raise ImportError('Requires the objgraph library')
-    print('Dumping graph for type %r' % (type, ))
+    logger.info('Dumping graph for type %r', type)
     with tempfile.NamedTemporaryFile(prefix='cobjg',
                                      suffix='.png', delete=False) as fh:
         objects = objgraph.by_type(type)[:num]

+ 1 - 1
celery/worker/state.py

@@ -9,7 +9,7 @@
     statistics, and revoked tasks.
 
 """
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import os
 import sys