From: JazzyNico Date: Sun, 29 Nov 2009 12:42:45 +0000 (+0100) Subject: Deprecation warning fix on xcf export X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bb1c97d66ed035554ef6d68f52f2c666c9da3b5f;p=inkscape.git Deprecation warning fix on xcf export --- 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()