Skip to content

Commit

Permalink
Use .freeze not ._freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Jun 17, 2013
1 parent 2f516fa commit 33a62b0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions celery/app/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def prepare_steps(self, args, tasks):
# First task get partial args from chain.
task = maybe_subtask(steps.popleft())
task = task.clone() if i else task.clone(args)
res = task._freeze()
res = task.freeze()
i += 1

if isinstance(task, group):
Expand All @@ -249,7 +249,7 @@ def prepare_steps(self, args, tasks):
next_step = steps.popleft()
# for chords we freeze by pretending it's a normal
# task instead of a group.
res = Signature._freeze(task)
res = Signature.freeze(task)
task = chord(task, body=next_step, task_id=res.task_id)
except IndexError:
pass # no callback, so keep as group
Expand Down Expand Up @@ -367,7 +367,7 @@ def apply_async(self, args=(), kwargs={}, task_id=None,
body.options['group_id'] = group_id
[body.link(s) for s in options.pop('link', [])]
[body.link_error(s) for s in options.pop('link_error', [])]
body_result = body._freeze(task_id)
body_result = body.freeze(task_id)
parent = super(Chord, self).apply_async((header, body, args),
kwargs, **options)
body_result.parent = parent
Expand Down
4 changes: 2 additions & 2 deletions celery/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, keypath):
self.path = path.split('.') if path else None

def _path(self, obj):
return (reduce(lambda d, k: d[k], [obj] + self.path) if self.path
return (reduce(lambda d, k: d[k], obj, self.path) if self.path
else obj)

def __get__(self, obj, type=None):
Expand Down Expand Up @@ -487,7 +487,7 @@ def __call__(self, body=None, task_id=None, **kwargs):
kwargs = dict(self.kwargs, body=body, **kwargs)
if _chord.app.conf.CELERY_ALWAYS_EAGER:
return self.apply((), kwargs)
res = body._freeze(task_id)
res = body.freeze(task_id)
parent = _chord(**kwargs)
res.parent = parent
return res
Expand Down
2 changes: 1 addition & 1 deletion celery/tests/backends/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def callback(result):
task = Mock()
task.request.group = 'grid'
cb = task.request.chord = callback.s()
task.request.chord._freeze()
task.request.chord.freeze()
callback.backend = b
callback.backend.fail_from_current_stack = Mock()
yield task, deps, cb
Expand Down
2 changes: 1 addition & 1 deletion celery/tests/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def _inner(*args, **kwargs):


def body_from_sig(app, sig, utc=True):
sig._freeze()
sig.freeze()
callbacks = sig.options.pop('link', None)
errbacks = sig.options.pop('link_error', None)
countdown = sig.options.pop('countdown', None)
Expand Down
2 changes: 1 addition & 1 deletion celery/tests/tasks/test_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_set_immutable(self):

def test_election(self):
x = add.s(2, 2)
x._freeze('foo')
x.freeze('foo')
prev, x.type.app.control = x.type.app.control, Mock()
try:
r = x.election()
Expand Down
2 changes: 1 addition & 1 deletion celery/tests/worker/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def test_tzlocal_is_cached(self):

def test_execute_magic_kwargs(self):
task = self.add.s(2, 2)
task._freeze()
task.freeze()
req = self.get_request(task)
self.add.accept_magic_kwargs = True
try:
Expand Down
2 changes: 1 addition & 1 deletion celery/tests/worker/test_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_when_rate_limited__limits_disabled(self):

def test_when_revoked(self):
task = self.add.s(2, 2)
task._freeze()
task.freeze()
state.revoked.add(task.id)
try:
with self._context(task) as C:
Expand Down

0 comments on commit 33a62b0

Please sign in to comment.