Skip to content
Snippets Groups Projects
Commit e3dab807 authored by Kevin Bullock's avatar Kevin Bullock
Browse files

compat: delay importing osutil until we know we need it

Since 006c837f9181 we don't need osutil on hg >= 4.3. When demandimport
is enabled, this extra import doesn't hurt anything, but it breaks
doctests.
parent da62ef05
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,6 @@
from mercurial import (
dirstate,
match as matchmod,
osutil,
scmutil,
util,
)
......@@ -156,6 +155,7 @@
matchalways = match.always()
matchtdir = match.traversedir
dmap = self._map
# osutil moved in hg 4.3, but util re-exports listdir
try:
listdir = util.listdir
except AttributeError:
......@@ -159,6 +159,7 @@
try:
listdir = util.listdir
except AttributeError:
from mercurial import osutil
listdir = osutil.listdir
lstat = os.lstat
dirkind = stat.S_IFDIR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment