xenia/tools/diff.py
Kriskras99 882f01533d Python 3 support (#755)
* Python 3 support

* Fix import_vs_environment in xenia-build

* Drop support for Python 2

* Fix CIs and xb.bat

* Require Python3.4+ because of Ubuntu Trusty

* popen.communicate returns bytes instead of string

* Useful info in travis

* universal_newlines should be True

* Changed shebang to python 3

* Python 3 shebang fix

* Clang python 3 shebang fix
2017-09-21 16:42:57 -05:00

13 lines
272 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""python diff.py file1 file2 diff"""
import difflib
import sys
diff = difflib.unified_diff(
open(sys.argv[1]).readlines(),
open(sys.argv[2]).readlines())
with open(sys.argv[3], 'w') as f:
f.write(''.join(diff))