rwl / pylon

Port of MATPOWER to Python.
http://rwl.github.com/pylon
Apache License 2.0
29 stars 10 forks source link

Various compatibility issues with newer python versions #6

Open LotharBrixius opened 11 months ago

LotharBrixius commented 11 months ago

E.g. in util.py izip must be chagend to zip. print in various files needs () to be added. Sometimes local files were not correctly imported in the init.py. "import sys" and sys.path.append() helps. cPickle needs to be replaced with _pickle, see https://askubuntu.com/questions/742782/how-to-install-cpickle-on-python-3-4 exceptions also work differently... https://stackoverflow.com/questions/1483429/how-do-i-print-an-exception-in-python Basestring to be replaced with str: https://stackoverflow.com/questions/60743762/basestring-equivalent-in-python3-str-and-string-types-from-future-and-six-not StringIO no longer in use, instead use: from io import StringIO, see https://stackoverflow.com/questions/11914472/how-to-use-stringio-in-python3