-
Task
-
Resolution: Done
-
Minor
-
None
-
None
-
False
-
False
-
-
2
-
2022-Q3
Right now we are using if else condition for solving the compatibility issues with renamed modules between Python 2 & 3. For solving this is library called six, which we are already using somewhere, so why not use it for solving this too.
This problem is mainly with mock from unittest, but I've spotted it with configparser too.
Example of the change:
# before if sys.version_info[:2] <= (2, 7): import mock else: from unittest import mock # after six.add_move(six.MovedModule("mock", "mock", "unittest.mock")) from six.moves import mock