summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-08-08 09:56:59 +1000
committerAndrew Godwin <andrew@aeracode.org>2014-08-08 09:57:49 +1000
commit267630ad50c69ebfe594de37a0636264aa5be7d6 (patch)
tree53fd63362cb688305151779ad338f46d0123f30b
parent29585e9b6a0ce15dc0149c8424cd11c3e27ee295 (diff)
[1.7.x] Don't treat .pyc/pyo files as migrations. Refs #23237 among others.
-rw-r--r--django/db/migrations/loader.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
index 5465f0ad18..2fb2098e48 100644
--- a/django/db/migrations/loader.py
+++ b/django/db/migrations/loader.py
@@ -89,10 +89,10 @@ class MigrationLoader(object):
six.moves.reload_module(module)
self.migrated_apps.add(app_config.label)
directory = os.path.dirname(module.__file__)
- # Scan for .py[c|o] files
+ # Scan for .py files
migration_names = set()
for name in os.listdir(directory):
- if name.endswith(".py") or name.endswith(".pyc") or name.endswith(".pyo"):
+ if name.endswith(".py"):
import_name = name.rsplit(".", 1)[0]
if import_name[0] not in "_.~":
migration_names.add(import_name)