0
0
mirror of https://github.com/django/django.git synced 2024-11-30 07:06:18 +01:00

Fixed #21868: Don't die when seeing py3 namespace packages for mig dirs

This commit is contained in:
Andrew Godwin 2014-02-09 14:03:41 +00:00
parent 11c021336c
commit 935e6c1dfc

View File

@ -39,7 +39,12 @@ class MigrationQuestioner(object):
except ImportError:
return self.defaults.get("ask_initial", False)
else:
if hasattr(migrations_module, "__file__"):
filenames = os.listdir(os.path.dirname(migrations_module.__file__))
elif hasattr(migrations_module, "__path__"):
if len(migrations_module.__path__) > 1:
return False
filenames = os.listdir(list(migrations_module.__path__)[0])
return not any(x.endswith(".py") for x in filenames if x != "__init__.py")
def ask_not_null_addition(self, field_name, model_name):