Skip to content

Instantly share code, notes, and snippets.

@loic
Created September 26, 2014 16:47
Show Gist options
  • Save loic/51d82cb820c1feb9505a to your computer and use it in GitHub Desktop.
Save loic/51d82cb820c1feb9505a to your computer and use it in GitHub Desktop.
diff --git a/django/db/migrations/writer.py b/django/db/migrations/writer.py
index 9709eec..e5e9f7a 100644
--- a/django/db/migrations/writer.py
+++ b/django/db/migrations/writer.py
@@ -352,7 +352,7 @@ class MigrationWriter(object):
return string, set(imports)
if hasattr(value, "__module__"):
module = value.__module__
- if module == 'builtins' if six.PY3 else '__builtin__':
+ if module == ('builtins' if six.PY3 else '__builtin__'):
return value.__name__, set()
else:
return "%s.%s" % (module, value.__name__), set(["import %s" % module])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment