Skip to content

Commit

Permalink
Merge pull request #215 from pllim/config-no-write
Browse files Browse the repository at this point in the history
MNT: Remove unused astropy config code
  • Loading branch information
pllim authored Apr 10, 2021
2 parents 42eaf27 + d22742d commit 70b4e09
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions stginga/_astropy_init.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from warnings import warn

from astropy import config
from astropy.config.configuration import (
ConfigurationDefaultMissingError, ConfigurationDefaultMissingWarning)
from astropy.tests.runner import TestRunner

try:
Expand All @@ -18,26 +14,3 @@
test.__test__ = False

__all__ = ['__version__', 'test']

# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
config.configuration.update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
config.configuration.update_default_config(
__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0] + " Cannot install default profile. "
"If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error

0 comments on commit 70b4e09

Please sign in to comment.