Skip to content

Commit d77ddeb

Browse files
committed
Fix deprecated function in use in _astropy_init.py
1 parent 6027e19 commit d77ddeb

File tree

1 file changed

+6
-44
lines changed

1 file changed

+6
-44
lines changed

turbustat/_astropy_init.py

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,14 @@
1-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
1+
import os
22

3-
__all__ = ['__version__']
3+
from astropy.tests.runner import TestRunner
44

5-
# this indicates whether or not we are in the package's setup.py
6-
try:
7-
_ASTROPY_SETUP_
8-
except NameError:
9-
import builtins
10-
builtins._ASTROPY_SETUP_ = False
5+
__all__ = ['__version__', 'test']
116

127
try:
138
from .version import version as __version__
149
except ImportError:
1510
__version__ = ''
1611

17-
18-
if not _ASTROPY_SETUP_: # noqa
19-
import os
20-
from warnings import warn
21-
from astropy.config.configuration import (
22-
update_default_config,
23-
ConfigurationDefaultMissingError,
24-
ConfigurationDefaultMissingWarning)
25-
26-
# Create the test function for self test
27-
from astropy.tests.runner import TestRunner
28-
test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
29-
test.__test__ = False
30-
__all__ += ['test']
31-
32-
# add these here so we only need to cleanup the namespace at the end
33-
config_dir = None
34-
35-
if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
36-
config_dir = os.path.dirname(__file__)
37-
config_template = os.path.join(config_dir, __package__ + ".cfg")
38-
if os.path.isfile(config_template):
39-
try:
40-
update_default_config(
41-
__package__, config_dir, version=__version__)
42-
except TypeError as orig_error:
43-
try:
44-
update_default_config(__package__, config_dir)
45-
except ConfigurationDefaultMissingError as e:
46-
wmsg = (e.args[0] +
47-
" Cannot install default profile. If you are "
48-
"importing from source, this is expected.")
49-
warn(ConfigurationDefaultMissingWarning(wmsg))
50-
del e
51-
except Exception:
52-
raise orig_error
12+
# Create the test function for self test
13+
test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
14+
test.__test__ = False

0 commit comments

Comments
 (0)