Skip to content

Commit

Permalink
pystache/loader.py: remove stray '\r' (on windows only)
Browse files Browse the repository at this point in the history
* replaces deprecated fix in defunkt/pystache#193

Signed-off-by: Stephen L Arnold <[email protected]>
  • Loading branch information
sarnold committed Nov 9, 2020
1 parent 18e49fc commit cf47eb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pystache/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import os
import platform
import sys

from pystache import common
Expand Down Expand Up @@ -118,7 +119,8 @@ def read(self, path, encoding=None):

if encoding is None:
encoding = self.file_encoding

if platform.system() == "Windows":
return self.unicode(b, encoding).replace('\r', '')
return self.unicode(b, encoding)

def load_file(self, file_name):
Expand Down

0 comments on commit cf47eb1

Please sign in to comment.