diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2013-07-26 17:08:12 +0100 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2013-07-26 17:08:12 +0100 |
| commit | c8cbdabfab3a150904a2214930e82112d0231ff2 (patch) | |
| tree | 244b85b9bdecfa9bbe636c80c067be0beb0e2e10 | |
| parent | d5ca1693341daccce9b0dd8504967a56b289d92f (diff) | |
Fix Python 3 support
| -rw-r--r-- | django/db/migrations/autodetector.py | 4 | ||||
| -rw-r--r-- | django/db/migrations/graph.py | 4 | ||||
| -rw-r--r-- | django/db/migrations/writer.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index d524f96a0b..e737cb8af9 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -367,9 +367,9 @@ class InteractiveMigrationQuestioner(MigrationQuestioner): return result[0].lower() == "y" def _choice_input(self, question, choices): - print question + print(question) for i, choice in enumerate(choices): - print " %s) %s" % (i + 1, choice) + print(" %s) %s" % (i + 1, choice)) result = input("Select an option: ") while True: try: diff --git a/django/db/migrations/graph.py b/django/db/migrations/graph.py index 1bbe0092ae..3b6495689a 100644 --- a/django/db/migrations/graph.py +++ b/django/db/migrations/graph.py @@ -70,7 +70,7 @@ class MigrationGraph(object): """ roots = set() for node in self.nodes: - if not filter(lambda key: key[0] == node[0], self.dependencies.get(node, set())): + if not any(key[0] == node[0] for key in self.dependencies.get(node, set())): roots.add(node) return roots @@ -84,7 +84,7 @@ class MigrationGraph(object): """ leaves = set() for node in self.nodes: - if not filter(lambda key: key[0] == node[0], self.dependents.get(node, set())): + if not any(key[0] == node[0] for key in self.dependents.get(node, set())): leaves.add(node) return leaves diff --git a/django/db/migrations/writer.py b/django/db/migrations/writer.py index 00e83681cd..4cc84dcca7 100644 --- a/django/db/migrations/writer.py +++ b/django/db/migrations/writer.py @@ -109,7 +109,7 @@ class MigrationWriter(object): elif isinstance(value, (datetime.datetime, datetime.date)): return repr(value), set(["import datetime"]) # Simple types - elif isinstance(value, (int, long, float, six.binary_type, six.text_type, bool, types.NoneType)): + elif isinstance(value, six.integer_types + (float, six.binary_type, six.text_type, bool, type(None))): return repr(value), set() # Django fields elif isinstance(value, models.Field): |
