Coverage for python/lsst/utils/backtrace/__init__.py: 67%

12 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-01-10 02:25 -0800

1# This file is part of utils. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# Use of this source code is governed by a 3-clause BSD-style 

10# license that can be found in the LICENSE file. 

11"""Temporary forwarding of backtrace to cpputils package.""" 

12 

13__all__ = ["isEnabled"] 

14 

15from deprecated.sphinx import deprecated 

16 

17try: 

18 # For now, ensure that backtrace has been imported if somebody 

19 # is relying on it from a lsst.utils import. Treat it as an optional 

20 # import. 

21 import lsst.cpputils.backtrace 

22except ImportError: 

23 pass 

24 

25from .._forwarded import _REASON, _VERSION_REMOVED 

26 

27 

28@deprecated(reason=_REASON, version=_VERSION_REMOVED, category=FutureWarning) 

29def isEnabled() -> bool: 

30 """Check that backtrace is enabled.""" 

31 from lsst.cpputils import backtrace 

32 

33 return backtrace.isEnabled()