Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PYPOWER should now work on Python 2 and 3 with the same codebase. I tested it
with 2.7 and 3., but 2.6 and 3.3 should also work. I don’t think support for older
Python versions is still necessary.
I couldn’t run all tests, because that also wasn’t possible with v4.0.1, but
all tests that passed with 4.0.1 are still passing. I also performed some
power flow computations and they also worked fine.
I didn’t apply all changes 2to3 suggested. The remaining ones are in
https://gist.github.com/sscherfke/9970540 (just in case ...).
These are the most frequent changes I had to apply:
print 'spam'
-->print('spam')
(print
is a function,exec
, too)raise Exception, 'value'
-->raise Exception('value')
(new Syntax for exceptions)from mod import fcn
-->from pypower.mod import fcn
(absolute/relative imports)basestring
in Py3. Setbasestring = str
here.