diff --git a/src/pricehist/fetch.py b/src/pricehist/fetch.py index 71bcdf3..e56a92b 100644 --- a/src/pricehist/fetch.py +++ b/src/pricehist/fetch.py @@ -6,7 +6,7 @@ from pricehist import exceptions def fetch(series, source, output, invert: bool, quantize: int, fmt) -> str: if series.start < source.start(): - logging.warn( + logging.warning( f"The start date {series.start} preceeds the {source.name()} " f"source start date of {source.start()}." ) @@ -15,7 +15,9 @@ def fetch(series, source, output, invert: bool, quantize: int, fmt) -> str: series = source.fetch(series) if len(series.prices) == 0: - logging.warn(f"No data found for the interval [{series.start}--{series.end}].") + logging.warning( + f"No data found for the interval [{series.start}--{series.end}]." + ) else: first = series.prices[0].date last = series.prices[-1].date @@ -28,7 +30,7 @@ def fetch(series, source, output, invert: bool, quantize: int, fmt) -> str: if first == series.start and last == expected_end: logging.debug(message) # Missing today's price is expected else: - logging.warn(message) + logging.warning(message) if invert: series = series.invert() diff --git a/src/pricehist/outputs/gnucashsql.py b/src/pricehist/outputs/gnucashsql.py index 0701908..1cb536b 100644 --- a/src/pricehist/outputs/gnucashsql.py +++ b/src/pricehist/outputs/gnucashsql.py @@ -110,7 +110,7 @@ class GnuCashSQL(BaseOutput): if too_big: # https://code.gnucash.org/docs/MAINT/group__Numeric.html # https://code.gnucash.org/docs/MAINT/structgnc__price__s.html - logging.warn( + logging.warning( "This SQL contains numbers outside of the int64 range required " "by GnuCash for the numerators and denominators of prices. " "Using the --quantize option to limit the number of decimal " @@ -132,7 +132,7 @@ class GnuCashSQL(BaseOutput): def _warn_about_backslashes(self, fields): hits = [name for name, value in fields.items() if "\\" in value] if hits: - logging.warn( + logging.warning( f"Before running this SQL, check the formatting of the " f"{self._english_join(hits)} strings. " f"SQLite treats backslahes in strings as plain characters, but "