From: W. Trevor King Date: Mon, 9 Dec 2013 04:34:05 +0000 (-0800) Subject: gallery.py: Use Python-3-compatible exception syntax X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b29fb3f3e29a7a9c51e1b05a9aa72605f9297d8;p=blog.git gallery.py: Use Python-3-compatible exception syntax Avoid: File "/home/wking/bin/gallery.py", line 120 except OSError, e: ^ SyntaxError: invalid syntax --- diff --git a/posts/gallery/gallery.py b/posts/gallery/gallery.py index baacbd8..1a3c958 100755 --- a/posts/gallery/gallery.py +++ b/posts/gallery/gallery.py @@ -114,7 +114,7 @@ def invoke(args, stdin=None, stdout=_subprocess.PIPE, stderr=_subprocess.PIPE, try : q = _subprocess.Popen(args, stdin=_subprocess.PIPE, stdout=stdout, stderr=stderr, cwd=cwd) - except OSError, e: + except OSError as e: raise CommandError(args, status=e.args[0], stderr=e) stdout,stderr = q.communicate(input=stdin) status = q.wait()