From e84a86d4ac0caf29d6074728376ff0a594243fec Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Thu, 4 Mar 2021 18:40:53 +0100 Subject: Update for Inkscape 1.0 (#880) * update for inkscape 1.0 * add about extension * Build improvements for the inkscape1.0 branch (#985) * zip: export real svg not stitch plan * #411 and #726 * Tools for Font Creators (#1018) * ignore very small holes in fills * remove embroider (#1026) * auto_fill: ignore shrink_or_grow if result is empty (#589) * break apart: do not ignore small fills Co-authored-by: Hagen Fritsch Co-authored-by: Lex Neva --- lib/utils/io.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/utils/io.py') diff --git a/lib/utils/io.py b/lib/utils/io.py index f51f629c..239585f4 100644 --- a/lib/utils/io.py +++ b/lib/utils/io.py @@ -1,15 +1,15 @@ import os import sys -from cStringIO import StringIO +from io import StringIO def save_stderr(): # GTK likes to spam stderr, which inkscape will show in a dialog. - null = open(os.devnull, 'w') - sys.stderr_dup = os.dup(sys.stderr.fileno()) - sys.real_stderr = os.fdopen(sys.stderr_dup, 'w') - os.dup2(null.fileno(), 2) - sys.stderr = StringIO() + with open(os.devnull, 'w') as null: + sys.stderr_dup = os.dup(sys.stderr.fileno()) + sys.real_stderr = os.fdopen(sys.stderr_dup, 'w', encoding='utf-8') + os.dup2(null.fileno(), 2) + sys.stderr = StringIO() def restore_stderr(): @@ -22,11 +22,11 @@ def restore_stderr(): def save_stdout(): - null = open(os.devnull, 'w') - sys.stdout_dup = os.dup(sys.stdout.fileno()) - sys.real_stdout = os.fdopen(sys.stdout_dup, 'w') - os.dup2(null.fileno(), 1) - sys.stdout = StringIO() + with open(os.devnull, 'w') as null: + sys.stdout_dup = os.dup(sys.stdout.fileno()) + sys.real_stdout = os.fdopen(sys.stdout_dup, 'w') + os.dup2(null.fileno(), 1) + sys.stdout = StringIO() def restore_stdout(): -- cgit v1.2.3