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

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

11 statements  

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 

12__all__ = ["isEnabled"] 

13 

14from deprecated.sphinx import deprecated 

15 

16try: 

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

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

19 # import. 

20 import lsst.cpputils.backtrace 

21except ImportError: 

22 pass 

23 

24from .._forwarded import _REASON, _VERSION_REMOVED 

25 

26 

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

28def isEnabled() -> bool: 

29 """Check that backtrace is enabled.""" 

30 from lsst.cpputils import backtrace 

31 return backtrace.isEnabled()