Skip to content

Commit ae228ee

Browse files
committed
pystache/loader.py: remove stray windows line-endings
* replaces deprecated fix in defunkt#193 Signed-off-by: Stephen L Arnold <[email protected]>
1 parent b519a41 commit ae228ee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pystache/loader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import os
9+
import platform
910
import sys
1011

1112
from pystache import common
@@ -118,8 +119,9 @@ def read(self, path, encoding=None):
118119

119120
if encoding is None:
120121
encoding = self.file_encoding
121-
122-
return self.str(b, encoding)
122+
if platform.system() == "Windows":
123+
return self.unicode(b, encoding).replace('\r', '')
124+
return self.unicode(b, encoding)
123125

124126
def load_file(self, file_name):
125127
"""

0 commit comments

Comments
 (0)