Skip to content

Commit

Permalink
Only emit DeprecationWarning once (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 30, 2024
2 parents f3f3be7 + b09d87a commit ffc7832
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/prettytable/prettytable.py
Original file line number Diff line number Diff line change
Expand Up @@ -2858,6 +2858,7 @@ def _warn_deprecation(name: str, module_globals: dict[str, Any]) -> Any:
if (val := module_globals.get(f"_DEPRECATED_{name}")) is None:
msg = f"module '{__name__}' has no attribute '{name}"
raise AttributeError(msg)
module_globals[name] = val
if name in {"FRAME", "ALL", "NONE", "HEADER"}:
msg = (
f"the '{name}' constant is deprecated, "
Expand Down

0 comments on commit ffc7832

Please sign in to comment.