pydot / pydot-ng

Python interface to Graphviz's Dot language compatible with Python 2 nad Python 3
MIT License
23 stars 10 forks source link

[97] Make dot_parser import error mutable #34

Closed prmtl closed 6 years ago

prmtl commented 9 years ago

Reported by s...@cloudlock.com, 2014-12-22T14:49:33Z

When you import pydot without having dot_parser installed, you get a warning like this:

"Couldn't import dot_parser, loading of dot files will not be possible"

Since this warning is output to stdout, you can't mute it, so if you don't need dot_parser, you have a warning you can never silence.

The attached patch replaces the print statement with a call to warnings.warn(), so that the import warning can be optionally muted. Attached patch.txt (view on Gist) From: https://code.google.com/p/pydot/issues/detail?id=97