-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
121 add line ending options #129
Conversation
…r return from main. Signed-off-by: Daira Hopwood <[email protected]>
Signed-off-by: Daira Hopwood <[email protected]>
Signed-off-by: Daira Hopwood <[email protected]>
Wait, why isn't https://travis-ci.org/python-modernize/python-modernize/jobs/86099411 running test_newlines? |
Signed-off-by: Daira Hopwood <[email protected]>
Ah, because I forgot to add the file :-p |
Signed-off-by: Daira Hopwood <[email protected]>
Signed-off-by: Daira Hopwood <[email protected]>
Signed-off-by: Daira Hopwood <[email protected]>
def _to_system_newlines(s): | ||
return s.replace(os.linesep, linesep) | ||
|
||
refactor._to_system_newlines = _to_system_newlines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure which I like less, changing an important value in the standard library or monkeypatching a private function in 2to3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative approach is to do the refactor._to_system_newlines
patch on Python 2 as well; I think that will work.
I think it's reasonable to offer users a way to explicitly set their preferred style of line endings, but I don't like the implementation based on monkeypatching stuff. I'm looking into how else it might be done. |
@takluyver do we have information about which file is going to be processed and if it was processed? |
fixes #121