Currently SortImports(file_contents=old_text).output returns None if isort:skip_file is present within the file being edited. This causes the new_lines = new_text.split('\n') a couple lines down to error with a AttributeError: 'NoneType' object has no attribute 'split' error. This guards against it.
Currently
SortImports(file_contents=old_text).output
returns None ifisort:skip_file
is present within the file being edited. This causes thenew_lines = new_text.split('\n')
a couple lines down to error with aAttributeError: 'NoneType' object has no attribute 'split'
error. This guards against it.