Skip to content
Myr

Disabled sys._getframes() on Python interpreters that don't support it

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by jhwgh1968 · committed by jhwgh1968 · parent df0e37d · Browse files · 2 files+7 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−1 removed

  • other:+7 added−1 removed

2 files+7 added−1 removed

modified:click/_unicodefun.py+2 added
12 unmodified lines
131415def _find_unicode_literals_frame():16 import __future__17 if not hasattr(sys, '_getframe'): # not all Python implementations have it18 return 019 frm = sys._getframe(1)20 idx = 121 while frm is not None:22 if frm.f_globals.get('__name__', '').startswith('click.'):
98 unmodified lines
modified:click/decorators.py+5 added-1 removed
233 unmodified lines
234 (``'%(prog)s, version %(version)s'``)235 :param others: everything else is forwarded to :func:`option`.236 """237 if version is None:238 if hasattr(sys, '_getframe'):238 module = sys._getframe(1).f_globals.get('__name__')239 module = sys._getframe(1).f_globals.get('__name__')240 else:241 module = ''242243 def decorator(f):244 prog_name = attrs.pop('prog_name', None)245 message = attrs.pop('message', '%(prog)s, version %(version)s')246
62 unmodified lines