##// END OF EJS Templates
Made blockbreakers' input encoding detection more robust to strange...
epatters -
Show More
@@ -75,7 +75,12 b' def remove_comments(src):'
75
75
76 def get_input_encoding():
76 def get_input_encoding():
77 """Return the default standard input encoding."""
77 """Return the default standard input encoding."""
78 return getattr(sys.stdin, 'encoding', 'ascii')
78 # There are strange environments for which sys.stdin.encoding is None. We
79 # ensure that a valid encoding is returned.
80 encoding = getattr(sys.stdin, 'encoding', None)
81 if encoding is None:
82 encoding = 'ascii'
83 return encoding
79
84
80 #-----------------------------------------------------------------------------
85 #-----------------------------------------------------------------------------
81 # Classes and functions
86 # Classes and functions
General Comments 0
You need to be logged in to leave comments. Login now