ref: bd06a22fb874dcc2a51255670656afec6f5e21ea
parent: 1d17d3e8104606da398becc8430d02aba5eea06b
author: C Nelson <[email protected]>
date: Fri Apr 6 09:12:30 EDT 2012
Making generate_diff_insert python2.7 compatible.
--- a/extras/crystal.py
+++ b/extras/crystal.py
@@ -5836,13 +5836,16 @@
newfile_fh.close()
try:
+ from subprocess import CalledProcessError
+ except ImportError:
+ CalledProcessError = None
+
+ try:
diffcontent = subprocess.check_output("diff -u ../main.asm " + newfile_filename, shell=True)
- except AttributeError, exc:
+ except (AttributeError, CalledProcessError):
p = subprocess.Popen(["diff", "-u", "../main.asm", newfile_filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
diffcontent = out
- except Exception, exc:
- raise exc
os.system("rm " + original_filename)
os.system("rm " + newfile_filename)