Skip to content

Commit 8649ae1

Browse files
committed
fixed bug
1 parent 5c21187 commit 8649ae1

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

astroquery_cli/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ def _dummy_getEffectiveLevel(self):
2222
aq_logger_mod.DummyLogger.getEffectiveLevel = _dummy_getEffectiveLevel
2323
except Exception:
2424
pass
25+
# Monkey patch for astroquery.logger._init_log to support astropy >= 6.0
26+
try:
27+
import importlib
28+
from astropy.logger import AstropyLogger
29+
aq_logger_mod = importlib.import_module("astroquery.logger")
30+
31+
def _new_init_log():
32+
"""Initializes the log, including the log levels and log writer."""
33+
log = AstropyLogger('astroquery')
34+
# log._set_defaults() # This line is removed as it's deprecated in astropy 6.0
35+
return log
36+
37+
if hasattr(aq_logger_mod, '_init_log'):
38+
aq_logger_mod._init_log = _new_init_log
39+
40+
except Exception:
41+
pass
2542
from io import StringIO
2643
from contextlib import redirect_stdout
2744
from astropy.config import get_config_dir, get_config

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "astroquery_cli"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
description = "CLI for astroquery modules with autocompletion."
55
authors = ["inoribea <inoribea@outlook.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)