summaryrefslogtreecommitdiff
path: root/testutils.py
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2013-12-23 10:05:59 +0200
committercpopa <devnull@localhost>2013-12-23 10:05:59 +0200
commitf1e7739c5b99d65f22fd23bfbdf6ca2c52f5ae32 (patch)
treeca4c85dded358e743b60affd56858fa7bc7e891b /testutils.py
parentd8895fcb65ecd958b627298b32b0592565ef137e (diff)
downloadpylint-f1e7739c5b99d65f22fd23bfbdf6ca2c52f5ae32.tar.gz
Fix various issues with linesep for Windows
Diffstat (limited to 'testutils.py')
-rw-r--r--testutils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testutils.py b/testutils.py
index 77eaffe..a61fa7f 100644
--- a/testutils.py
+++ b/testutils.py
@@ -38,6 +38,7 @@ from pylint.lint import PyLinter
SYS_VERS_STR = '%d%d' % sys.version_info[:2]
TITLE_UNDERLINES = ['', '=', '-', '.']
PREFIX = abspath(dirname(__file__))
+PY3K = sys.version_info[0] == 3
def fix_path():
sys.path.insert(0, PREFIX)
@@ -99,6 +100,10 @@ class TestReporter(BaseReporter):
if obj:
obj = ':%s' % obj
sigle = msg_id[0]
+ if PY3K and linesep != '\n':
+ # 2to3 writes os.linesep instead of using
+ # the previosly used line separators
+ msg = msg.replace('\r\n', '\n')
self.messages.append('%s:%3s%s: %s' % (sigle, line, obj, msg))
def finalize(self):