8000 Fix stripping of CRLF on Windows. · deniederhut/matplotlib@0229348 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0229348

Browse files
anntzerKojoley
authored andcommitted
Fix stripping of CRLF on Windows.
1 parent 6fd8b5b commit 0229348

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/dviread.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,14 +1025,14 @@ def find_tex_file(filename, format=None):
10251025
if format is not None:
10261026
cmd += ['--format=' + format]
10271027
cmd += [filename]
1028-
try: # Below: strip final newline.
1029-
result = cbook._check_and_log_subprocess(cmd, _log, **kwargs)[:-1]
1028+
try:
1029+
result = cbook._check_and_log_subprocess(cmd, _log, **kwargs)
10301030
except RuntimeError:
10311031
return ''
10321032
if os.name == 'nt':
1033-
return result.decode('utf-8')
1033+
return result.decode('utf-8').rstrip('\r\n')
10341034
else:
1035-
return os.fsdecode(result)
1035+
return os.fsdecode(result).rstrip('\n')
10361036

10371037

10381038
@lru_cache()

0 commit comments

Comments
 (0)
0