Originally reported on Google Code with ID 51
The attached patch fixes iwyu_test_util.py to run with Python 3.2.1. It also addresses
a couple of Windows-specific issues.
Whilst I do't expect this to be committed (I expect you might be targetting an older
version of Python?) it might be useful for anyone having problems running the tests.
If it's useful I can update the Wiki with a link to this issue.
The fixes are:
lines 42-43) Windows needs to normalise dir separators and look for '.exe'
line 71) Windows can't set close_fds=True and redirect stdout/stderr
line 72) With Python 3, the process output is treated as a bytes and needs to be decoded
as utf-8 before it can be treated as a string
lines 205-206, 216) Fix a warning about leaking file handles (Python3? Related to close_fds
change above?)
line 331) With Python 3, generator.next() becomes next(generator)
lines 365, 367) With Python 3, 'print x' becomes 'print(x)'
line 381) assert_ is deprecated and should be replaced with assertTrue
Reported by paul.holden on 2011-07-16 14:10:33
- Attachment: iwyu_test_util.patch
该提问来源于开源项目:include-what-you-use/include-what-you-use