Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handles error, "required string got bytes in sys.stdout" #1

Merged
merged 2 commits into from
May 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions icdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,13 @@ class PassThroughOptionParser(OptionParser):
def _process_long_opt(self, rargs, values):
try:
OptionParser._process_long_opt(self, rargs, values)
except BadOptionError, err:
except BadOptionError as err:
self.largs.append(err.opt_str)

def _process_short_opts(self, rargs, values):
try:
OptionParser._process_short_opts(self, rargs, values)
except BadOptionError, err:
except BadOptionError as err:
self.largs.append(err.opt_str)

def get_options():
Expand Down Expand Up @@ -532,7 +532,7 @@ def codec_print(s, options):
if hasattr(sys.stdout, "buffer"):
sys.stdout.buffer.write(s.encode(options.output_encoding))
else:
sys.stdout.write(s.encode(options.output_encoding))
sys.stdout.write(bytes.decode((s.encode(options.output_encoding))))


def diff(a, b, options=None):
Expand Down