We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9634b5 commit fb2c025Copy full SHA for fb2c025
schemascii/__main__.py
@@ -1,5 +1,6 @@
1
import argparse
2
import sys
3
+import warnings
4
from . import render, __version__
5
from .errors import Error
6
@@ -49,10 +50,14 @@ def cli_main():
49
50
text = sys.stdin.read()
51
args.in_file = "<stdin>"
52
try:
- result_svg = render(args.in_file, text, **vars(args))
53
+ with warnings.catch_warnings(record=True) as captured_warnings:
54
+ result_svg = render(args.in_file, text, **vars(args))
55
except Error as err:
56
print(type(err).__name__ + ":", err, file=sys.stderr)
57
sys.exit(1)
58
+ if captured_warnings:
59
+ for warn in captured_warnings:
60
+ print("warning:", warn.message, file=sys.stderr)
61
if args.out_file == "-":
62
print(result_svg)
63
else:
0 commit comments