mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
this can be slightly less ugly
This commit is contained in:
parent
a8adceb431
commit
2f6f7436aa
1 changed files with 1 additions and 1 deletions
|
@ -123,7 +123,7 @@ def requires(resource, msg=None):
|
|||
possibility of False being returned occurs when regrtest.py is executing."""
|
||||
# see if the caller's module is __main__ - if so, treat as if
|
||||
# the resource was set
|
||||
if sys._getframe().f_back.f_globals.get("__name__") == "__main__":
|
||||
if sys._getframe(1).f_globals.get("__name__") == "__main__":
|
||||
return
|
||||
if not is_resource_enabled(resource):
|
||||
if msg is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue