six_ext
– Python 2 and 3 compatibility layer¶
Extensions to six
python 2 and 3 compatibility layer.
The following exceptions are more descriptive aliases to python 3 or python 2 exceptions.
Name | Python 3 name | Python 2 name | Description |
---|---|---|---|
FileOpenError |
FileNotFoundError |
IOError |
File not found |
SubprocessExeError |
FileNotFoundError |
OSError |
subprocess.Popen does not find the file to execute |
ConfigFileError |
FileNotFoundError |
OSError |
Configuration file not found |
The module also provided some modules renamed as described in the six documentation.
Name | Python 3 name | Python 2 name |
---|---|---|
mock | unittest.mock | mock |
Example of used of renamed modules
>>> from pyhetdex.tools.six_ext import mock
>>> # or if :mod:`~pyhetdex.tools.six_ext` has already been imported somewhere
>>> # in the code
>>> from six.moves import mock