Skip to content
Myr

Make unicode_literals detector failure resistent

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

Apparently Sphinx creates a frame where there's no global __name__.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent 5eca206 · Browse files · 1 file+1 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

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:click/_compat.py+1 added-1 removed
19 unmodified lines
20 import __future__21 frm = sys._getframe(1)22 idx = 123 while frm is not None:24 if frm.f_globals.get('__name__').startswith('click.'):24 if frm.f_globals.get('__name__', '').startswith('click.'):25 frm = frm.f_back26 idx += 127 elif frm.f_code.co_flags & __future__.unicode_literals.compiler_flag:28 return idx
596 unmodified lines