From c196e2901c449d96bf5116e6988610c38ca8b725 Mon Sep 17 00:00:00 2001 From: Divya Jain Date: Fri, 17 Jul 2020 03:26:58 +0530 Subject: [PATCH] #509: Fixed correction on windows machine running other shells (#1091) * Replaced print with sys.stdout.write * Fixed tests * Normalized line endings --- tests/test_types.py | 2 +- thefuck/types.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_types.py b/tests/test_types.py index f946a8b8..4d0f0f70 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -41,7 +41,7 @@ class TestCorrectedCommand(object): settings.update(override_settings) CorrectedCommand(script, None, 1000).run(Command(script, '')) out, _ = capsys.readouterr() - assert out[:-1] == printed + assert out == printed class TestRule(object): diff --git a/thefuck/types.py b/thefuck/types.py index 5afcf2c4..5d8c2cc7 100644 --- a/thefuck/types.py +++ b/thefuck/types.py @@ -255,4 +255,4 @@ class CorrectedCommand(object): logs.debug(u'PYTHONIOENCODING: {}'.format( os.environ.get('PYTHONIOENCODING', '!!not-set!!'))) - print(self._get_script()) + sys.stdout.write(self._get_script())