Skip to content

Commit

Permalink
Fixed #12384: fixed a Python 2.4 incompatibility introduced in [11863].
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11884 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Dec 16, 2009
1 parent b38e678 commit c0c6e7d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions django/core/management/commands/dumpdata.py
Expand Up @@ -137,10 +137,15 @@ def sort_dependencies(app_list):
changed = False changed = False
while model_dependencies: while model_dependencies:
model, deps = model_dependencies.pop() model, deps = model_dependencies.pop()
if all((d not in models or d in model_list) for d in deps):
# If all of the models in the dependency list are either already # If all of the models in the dependency list are either already
# on the final model list, or not on the original serialization list, # on the final model list, or not on the original serialization list,
# then we've found another model with all it's dependencies satisfied. # then we've found another model with all it's dependencies satisfied.
found = True
for candidate in ((d not in models or d in model_list) for d in deps):
if not candidate:
found = False
if found:
model_list.append(model) model_list.append(model)
changed = True changed = True
else: else:
Expand All @@ -152,4 +157,4 @@ def sort_dependencies(app_list):
) )
model_dependencies = skipped model_dependencies = skipped


return model_list return model_list

0 comments on commit c0c6e7d

Please sign in to comment.