Commit c8cbdabf authored by Andrew Godwin's avatar Andrew Godwin
Browse files

Fix Python 3 support

parent d5ca1693
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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:
+2 −2
Original line number Diff line number Diff line
@@ -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

+1 −1
Original line number Diff line number Diff line
@@ -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):