Skip to content

Commit

Permalink
Fixed bug with \r
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacg1 committed Aug 3, 2017
1 parent ab4f6ff commit 4ae2a66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions extra_parse.py
Expand Up @@ -39,6 +39,8 @@ def str_parse_next(active_token):
continue
if active_token[point] == '\n':
out.append('\\n')
elif active_token[point] == '\r':
out.append('\\r')
elif active_token[point] == '\0':
out.append('\\000')
else:
Expand Down
2 changes: 1 addition & 1 deletion pyth.py
Expand Up @@ -713,7 +713,7 @@ def flag_on(short_form, long_form):
pyth_code = file_or_string
else:
if not execute_stdin:
code_lines = list(open(file_or_string, encoding='iso-8859-1'))
code_lines = list(open(file_or_string, encoding='iso-8859-1', newline=''))
if line_on:
runable_code_lines = [code_line[:-1]
for code_line in code_lines
Expand Down

0 comments on commit 4ae2a66

Please sign in to comment.