Format: text/x-python
⬇ Download File (831 B)
   1  """
   2  Get information about what a frame is currently doing. Typical usage:
   3  
   4      import executing
   5  
   6      node = executing.Source.executing(frame).node
   7      # node will be an AST node or None
   8  """
   9  
  10  from collections import namedtuple
  11  _VersionInfo = namedtuple('_VersionInfo', ('major', 'minor', 'micro'))
  12  from .executing import Source, Executing, only, NotOneValueFound, cache, future_flags
  13  
  14  from ._pytest_utils import is_pytest_compatible
  15  
  16  try:
  17      from .version import __version__ # type: ignore[import]
  18      if "dev" in __version__:
  19          raise ValueError
  20  except Exception:
  21      # version.py is auto-generated with the git tag when building
  22      __version__ = "???"
  23      __version_info__ = _VersionInfo(-1, -1, -1)
  24  else:
  25      __version_info__ = _VersionInfo(*map(int, __version__.split('.')))
  26  
  27  
  28  __all__ = ["Source","is_pytest_compatible"]
  29