summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2014-06-14 02:54:49 +0600
committerArmin Ronacher <armin.ronacher@active-4.com>2014-06-14 02:54:49 +0600
commit8ff7d53fc908f08cb2b185ca1fc4875351d4a945 (patch)
tree842bf7ec7ece295eea05c47fe9fbc938c489ba11
parent2b08764844db45d531d400ca4d76af5f91ef3a3f (diff)
downloadclick-8ff7d53fc908f08cb2b185ca1fc4875351d4a945.tar.gz
Fixed an issue with custom types on Python 3.
-rw-r--r--CHANGES1
-rw-r--r--click/types.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index b2f98a8..93f64f9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,7 @@ Version 2.1
characters wide instead of 79
- use colorama win32 bindings if available to get the correct
dimensions of a windows terminal.
+- fixed an issue with custom function types on Python 3.
Version 2.0
-----------
diff --git a/click/types.py b/click/types.py
index 92983b5..91d136a 100644
--- a/click/types.py
+++ b/click/types.py
@@ -78,7 +78,7 @@ class FuncParamType(ParamType):
return self.func(value)
except ValueError:
try:
- value = unicode(value)
+ value = text_type(value)
except UnicodeError:
value = str(value).decode('utf-8', 'replace')
self.fail(value, param, ctx)