From bb1c97d66ed035554ef6d68f52f2c666c9da3b5f Mon Sep 17 00:00:00 2001 From: JazzyNico Date: Sun, 29 Nov 2009 13:42:45 +0100 Subject: [PATCH] Deprecation warning fix on xcf export --- share/extensions/gimp_xcf.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py index 22e45006b..92da6cf40 100755 --- a/share/extensions/gimp_xcf.py +++ b/share/extensions/gimp_xcf.py @@ -19,6 +19,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import inkex import sys, os, tempfile +try: + from subprocess import Popen, PIPE + bsubprocess = True +except: + bsubprocess = False + class MyEffect(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) @@ -95,7 +101,13 @@ class MyEffect(inkex.Effect): name = "%s.png" % id filename = os.path.join(tmp_dir, name) command = "inkscape -i %s -j %s -e %s %s " % (id, area, filename, svg_file) - _,f,err = os.popen3(command,'r') + if bsubprocess: + p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) + return_code = p.wait() + f = p.stdout + err = p.stderr + else: + _,f,err = os.popen3(command,'r') f.read() f.close() err.close() -- 2.30.2