Skip to content

Commit

Permalink
Merge branch '6.x-maintenance'
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Feb 13, 2017
2 parents a72baa4 + 7c82b77 commit 8d9dd46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ Version 7.0
- `CliRunner.invoke` now may receive `args` as a string representing
a Unix shell command. See #664.

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
-----------

Expand Down
2 changes: 2 additions & 0 deletions click/_unicodefun.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

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:
Expand Down
6 changes: 5 additions & 1 deletion click/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 8d9dd46

Please sign in to comment.