summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorFlorian Scherf <f.scherf@pengutronix.de>2016-02-04 00:09:45 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-02-04 11:36:55 +0100
commit32e0000268f76ee4a071c845c904fd1ef7d0d2a0 (patch)
tree4602a1e562b866061a3b56c6113fc9ca467c29ee /patches
parente79a4fa945792868d84405f11ec29cbc92272112 (diff)
downloadptxdist-32e0000268f76ee4a071c845c904fd1ef7d0d2a0.tar.gz
ptxdist-32e0000268f76ee4a071c845c904fd1ef7d0d2a0.tar.xz
python3-django: fix migrations
Signed-off-by: Florian Scherf <f.scherf@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch36
-rw-r--r--patches/Django-1.8.7/series1
2 files changed, 37 insertions, 0 deletions
diff --git a/patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch b/patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch
new file mode 100644
index 000000000..a1dc20dff
--- /dev/null
+++ b/patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch
@@ -0,0 +1,36 @@
+From 65d28e3e9a47ad270e7017b6b2b269978c01c428 Mon Sep 17 00:00:00 2001
+From: Florian Scherf <f.scherf@pengutronix.de>
+Date: Wed, 3 Feb 2016 17:32:32 +0100
+Subject: [PATCH] MigrationLoader: search for *.py(c)
+
+The MigrationLoader originally searchs for *.py but we
+are running *.pyc only.
+Without this patch "./manage.py migrate" will crash.
+
+Signed-off-by: Florian Scherf <f.scherf@pengutronix.de>
+---
+ django/db/migrations/loader.py | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
+index bbd60a6..77b50fd 100644
+--- a/django/db/migrations/loader.py
++++ b/django/db/migrations/loader.py
+@@ -88,10 +88,12 @@ class MigrationLoader(object):
+ six.moves.reload_module(module)
+ self.migrated_apps.add(app_config.label)
+ directory = os.path.dirname(module.__file__)
+- # Scan for .py files
++ # Scan for .py(c) files
+ migration_names = set()
+ for name in os.listdir(directory):
+- if name.endswith(".py"):
++ root, ext = os.path.splitext(name)
++
++ if ext in ['.py', '.pyc']:
+ import_name = name.rsplit(".", 1)[0]
+ if import_name[0] not in "_.~":
+ migration_names.add(import_name)
+--
+2.7.0.rc3
+
diff --git a/patches/Django-1.8.7/series b/patches/Django-1.8.7/series
index 3f7010a4a..c644f907c 100644
--- a/patches/Django-1.8.7/series
+++ b/patches/Django-1.8.7/series
@@ -1 +1,2 @@
0001-Fixed-25322-Lazily-compiled-core.validators-regular-.patch
+0002-MigrationLoader-search-for-.py-c.patch