Show More
@@ -72,7 +72,13 b' def remove_comments(src):' | |||
|
72 | 72 | |
|
73 | 73 | def get_input_encoding(): |
|
74 | 74 | """Return the default standard input encoding.""" |
|
75 | return getattr(sys.stdin, 'encoding', 'ascii') | |
|
75 | ||
|
76 | # There are strange environments for which sys.stdin.encoding is None. We | |
|
77 | # ensure that a valid encoding is returned. | |
|
78 | encoding = getattr(sys.stdin, 'encoding', None) | |
|
79 | if encoding is None: | |
|
80 | encoding = 'ascii' | |
|
81 | return encoding | |
|
76 | 82 | |
|
77 | 83 | #----------------------------------------------------------------------------- |
|
78 | 84 | # Classes and functions |
General Comments 0
You need to be logged in to leave comments.
Login now