mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-04-25 07:36:47 -05:00
Making generate_diff_insert python2.7 compatible.
original-commit-id: bd06a22fb874dcc2a51255670656afec6f5e21ea
This commit is contained in:
parent
015d676f5a
commit
84fc578838
|
|
@ -5835,14 +5835,17 @@ def generate_diff_insert(line_number, newline, debug=False):
|
|||
newfile_fh.write(newfile)
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user