[Python-modules-commits] [django-celery] 01/03: Fix python3 issues

Brian May bam at moszumanska.debian.org
Sun Oct 25 23:13:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

bam pushed a commit to branch master
in repository django-celery.

commit 82fc0be53a36aebd4ca981f7e6bf2d63b1c5be2a
Author: Brian May <bam at debian.org>
Date:   Mon Oct 26 09:07:25 2015 +1100

    Fix python3 issues
    
    Reported upsteam https://github.com/celery/django-celery/issues/342
---
 djcelery/loaders.py | 3 ++-
 djcelery/views.py   | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/djcelery/loaders.py b/djcelery/loaders.py
index c86455a..61c6d04 100644
--- a/djcelery/loaders.py
+++ b/djcelery/loaders.py
@@ -201,7 +201,8 @@ def find_related_module(app, related_name):
         return
 
     try:
-        imp.find_module(related_name, app_path)
+        file, _, _ = imp.find_module(related_name, app_path)
+        file.close()
     except ImportError:
         return
 
diff --git a/djcelery/views.py b/djcelery/views.py
index 34cb307..4d07e0a 100644
--- a/djcelery/views.py
+++ b/djcelery/views.py
@@ -34,7 +34,7 @@ def task_view(task):
         kwargs = kwdict(request.method == 'POST' and
                         request.POST or request.GET)
         # no multivalue
-        kwargs = dict(((k, v) for k, v in kwargs.iteritems()), **options)
+        kwargs = dict(((k, v) for k, v in kwargs.items()), **options)
         result = task.apply_async(kwargs=kwargs)
         return JsonResponse({'ok': 'true', 'task_id': result.task_id})
 
@@ -78,8 +78,8 @@ def task_status(request, task_id):
 
 def registered_tasks(request):
     """View returning all defined tasks as a JSON object."""
-    return JsonResponse({'regular': tasks.regular().keys(),
-                         'periodic': tasks.periodic().keys()})
+    return JsonResponse({'regular': list(tasks.regular().keys()),
+                         'periodic': list(tasks.periodic().keys())})
 
 
 def task_webhook(fun):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-celery.git



More information about the Python-modules-commits mailing list