summaryrefslogtreecommitdiff
path: root/testutils.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2013-12-23 10:05:59 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2013-12-23 10:05:59 +0200
commit0fe5903cb1417c4bf6198b54ccde958077b4c842 (patch)
tree40ca29078c0c523f1f81bb58192038ce426f149c /testutils.py
parent99196f23052a5d04ad5135b815d19ff4771db27c (diff)
downloadpylint-git-0fe5903cb1417c4bf6198b54ccde958077b4c842.tar.gz
Fix various issues with linesep for Windows
--HG-- branch : fixes
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 77eaffe0f..a61fa7fce 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):