Mercurial > hg
diff mercurial/compat.h @ 29584:06587edd1233
pycompat: make pycompat demandimport friendly
pycompat.py includes hack to import modules whose names are changed in Python 3.
We use try-except to load module according to the version of python. But this
method forces us to import the modules to raise an ImportError and hence making
it demandimport unfriendly.
This patch changes the try-except blocks to a single if-else block. To avoid
test-check-pyflakes.t complain about unused imports, pycompat.py is excluded
from the test.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 17 Jul 2016 19:48:04 +0530 |
parents | 7b22599dcb85 |
children | f4433f2713d0 |