diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2014-06-14 02:54:49 +0600 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2014-06-14 02:54:49 +0600 |
commit | 8ff7d53fc908f08cb2b185ca1fc4875351d4a945 (patch) | |
tree | 842bf7ec7ece295eea05c47fe9fbc938c489ba11 | |
parent | 2b08764844db45d531d400ca4d76af5f91ef3a3f (diff) | |
download | click-8ff7d53fc908f08cb2b185ca1fc4875351d4a945.tar.gz |
Fixed an issue with custom types on Python 3.
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | click/types.py | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -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) |