On 09/14/2017 02:06 PM, Paul Burton wrote:
In python 3.x the configparser module is named with all lower case.
Import it as such in order to avoid errors when running on python 3.x,
and fall back to the CamelCase version in order to keep working with
python 2.x.

diff --git a/test/py/conftest.py b/test/py/conftest.py

+try:
+    import configparser as ConfigParser
+except:
+    import ConfigParser

Nit: Since Python 3 is the future, I wonder if we want to bias the code towards it:

try:
    import configparser
except:
    import ConfigParser as configparser

... and conver the one use of ConfigParser below to configparser?

Similarly, it might make sense to do something similar in the next patch; Python 3 code in "try", and Python 2 compatibility code in "except".

That said, the code works fine either way, so I don't care much whether you make this change.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to