Skip to content

Commit da98dd7

Browse files
committed
BUG: Fully respect PYTHONWARNINGS, when set
Fixes #331
1 parent c2c1320 commit da98dd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pdoc/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ def main(_args=None):
432432
global args
433433
args = _args or parser.parse_args()
434434

435-
warnings.simplefilter("once", DeprecationWarning)
435+
# If warnings not externally managed, show deprecation warnings
436+
if not sys.warnoptions:
437+
warnings.simplefilter("once", DeprecationWarning)
436438

437439
if args.close_stdin:
438440
sys.stdin.close()

0 commit comments

Comments
 (0)