From 60fd967cb8ff60fd7f49ca95a39f994f5ffc3cab Mon Sep 17 00:00:00 2001 From: jhwgh1968 Date: Thu, 9 Feb 2017 23:23:00 -0600 Subject: Disabled sys._getframes() on Python interpreters that don't support it --- click/_unicodefun.py | 2 ++ click/decorators.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/click/_unicodefun.py b/click/_unicodefun.py index 9e17a38..7aa13ff 100644 --- a/click/_unicodefun.py +++ b/click/_unicodefun.py @@ -14,6 +14,8 @@ click = sys.modules[__name__.rsplit('.', 1)[0]] def _find_unicode_literals_frame(): import __future__ + if not hasattr(sys, '_getframe'): # not all Python implementations have it + return 0 frm = sys._getframe(1) idx = 1 while frm is not None: diff --git a/click/decorators.py b/click/decorators.py index 9893452..64af015 100644 --- a/click/decorators.py +++ b/click/decorators.py @@ -235,7 +235,11 @@ def version_option(version=None, *param_decls, **attrs): :param others: everything else is forwarded to :func:`option`. """ if version is None: - module = sys._getframe(1).f_globals.get('__name__') + if hasattr(sys, '_getframe'): + module = sys._getframe(1).f_globals.get('__name__') + else: + module = '' + def decorator(f): prog_name = attrs.pop('prog_name', None) message = attrs.pop('message', '%(prog)s, version %(version)s') -- cgit v1.2.1 From 1d5aa254e28306d4d0074e5e81d815edcd73bcb5 Mon Sep 17 00:00:00 2001 From: jhwgh1968 Date: Sat, 11 Feb 2017 11:06:30 -0600 Subject: Updated CHANGES --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index 07b1694..060a30a 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,14 @@ Click Changelog This contains all major version changes between Click releases. +Version 6.8 +----------- + +(bugfix release; yet to be released) + +- Disabled sys._getframes() on Python interpreters that don't support it. See + #728. + Version 6.7 ----------- -- cgit v1.2.1