Skip to content

Commit 19acded

Browse files
committed
logger: utils: fs: use lazy formatting
1 parent 65c0c7e commit 19acded

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

dvc/rwlock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from .exceptions import DvcException
1111
from .lock import LockError
12-
from .utils.fs import relpath
12+
from .utils import relpath
1313

1414
INFO_SCHEMA = {"pid": int, "cmd": str}
1515

dvc/utils/fs.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from dvc.utils import dict_md5
1414
from dvc.utils import fspath
1515
from dvc.utils import fspath_py35
16-
from dvc.utils import relpath
1716

1817

1918
logger = logging.getLogger(__name__)
@@ -30,7 +29,7 @@ def fs_copy(src, dst):
3029

3130
def get_inode(path):
3231
inode = System.inode(path)
33-
logger.debug("Path {} inode {}".format(path, inode))
32+
logger.debug("Path {} inode {}", path, inode)
3433
return inode
3534

3635

@@ -131,10 +130,9 @@ def _chmod(func, p, excinfo):
131130

132131

133132
def remove(path):
134-
path = fspath_py35(path)
135-
136-
logger.debug("Removing '{}'".format(relpath(path)))
133+
logger.debug("Removing '{}'", path)
137134

135+
path = fspath_py35(path)
138136
try:
139137
if os.path.isdir(path):
140138
shutil.rmtree(path, onerror=_chmod)

0 commit comments

Comments
 (0)