Skip to content

Commit 9c334bb

Browse files
committed
Issuing warnings instead of prints in cosmosim, removing unused imports too
1 parent 8c37a1d commit 9c334bb

File tree

2 files changed

+133
-135
lines changed

2 files changed

+133
-135
lines changed

astroquery/besancon/core.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import sys
77
import re
88
import os
9+
import warnings
910
from astropy.io import ascii
1011
from astropy.extern.six.moves.urllib_error import URLError
11-
from astropy.extern.six import StringIO
1212
from collections import OrderedDict
1313
from ..query import BaseQuery
1414
from ..utils import commons
@@ -428,9 +428,10 @@ def parse_besancon_model_string(bms,):
428428

429429
for cn in besancon_table.columns:
430430
if besancon_table[cn].dtype.kind in ('s', 'S'):
431-
print("WARNING: The Besancon table did not parse properly. "
432-
"Some columns are likely to have invalid values and others incorrect values. "
433-
"Please report this error.")
431+
warnings.warn("The Besancon table did not parse properly. "
432+
"Some columns are likely to have invalid "
433+
"values and others incorrect values. "
434+
"Please report this error.")
434435
break
435436

436437
return besancon_table

0 commit comments

Comments
 (0)