diff --git a/svg2tikz/tikz_export.py b/svg2tikz/tikz_export.py index d98fd27..d12b72e 100644 --- a/svg2tikz/tikz_export.py +++ b/svg2tikz/tikz_export.py @@ -40,6 +40,12 @@ from inkex.transforms import Vector2d from lxml import etree +try: + SYS_OUTPUT_BUFFER = sys.stdout.buffer +except AttributeError: + logging.warning("Sys has no output buffer, redirecting to None") + SYS_OUTPUT_BUFFER = None + #### Utility functions and classes TIKZ_BASE_COLOR = [ @@ -1337,7 +1343,7 @@ def save_raw(self, _): self.options.output.write(out) - def run(self, args=None, output=sys.stdout.buffer): + def run(self, args=None, output=SYS_OUTPUT_BUFFER): """ Custom inkscape entry point to remove agr processing """