Closed
Description
$ cat test.py
# -*- coding:utf-8 -*-
class Foo(object):
def bar(self):
return 'baz'
$ isort --diff -a 'from __future__ import absolute_import' test.py
--- /Users/adamj/Documents/Projects/pyticketswitch/test.py:before 2016-04-29 15:32:17
+++ /Users/adamj/Documents/Projects/pyticketswitch/test.py:after 2016-04-29 15:32:36.902051
@@ -1,5 +1,6 @@
# -*- coding:utf-8 -*-
class Foo(object):
+from __future__ import absolute_import
def bar(self):
return 'baz'
This doesn't happen if there is no encoding comment at the start of the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment