Skip to content

Commit

Permalink
Merge branch '6.x-maintenance'
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Dec 6, 2017
2 parents 2ab7a2b + 9bd66b3 commit 92532b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Version 6.8
- Fix crash on Windows console, see #744.
- Fix bashcompletion on chained commands. See #754.
- Fix option naming routine to match documentation. See #793
- Fixed the behavior of click error messages with regards to unicode on 2.x
and 3.x respectively. Message is now always unicode and the str and unicode
special methods work as you expect on that platform.

Version 6.7
-----------
Expand Down
9 changes: 6 additions & 3 deletions click/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ def __init__(self, message):
def format_message(self):
return self.message

def __unicode__(self):
def __str__(self):
return self.message

def __str__(self):
return self.message.encode('utf-8')
if PY2:
__unicode__ = __str__

def __str__(self):
return self.message.encode('utf-8')

def show(self, file=None):
if file is None:
Expand Down

0 comments on commit 92532b5

Please sign in to comment.