]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Fix sorted of None values in compare for python 3
authorparadoxxxzero <paradoxxx.zero@gmail.com>
Tue, 24 Jun 2014 08:13:05 +0000 (08:13 +0000)
committerparadoxxxzero <paradoxxx.zero@gmail.com>
Tue, 24 Jun 2014 08:13:05 +0000 (08:13 +0000)
alembic/autogenerate/compare.py

index 0d58bec554e76339a133be1f08c453eb19c41a6b..4d6e5be918a19e11aea83bdf6e072d1b3480b326 100644 (file)
@@ -79,7 +79,8 @@ def _compare_tables(conn_table_names, metadata_table_names,
             inspector.reflecttable(t, None)
         conn_column_info[(s, tname)] = t
 
-    for s, tname in sorted(existing_tables):
+    for s, tname in sorted(existing_tables, key=lambda x: (x[0] or '', x[1])):
+        s = s or None
         name = '%s.%s' % (s, tname) if s else tname
         metadata_table = tname_to_table[(s, tname)]
         conn_table = existing_metadata.tables[name]