From 9c9079753bd61ed5fb1fa4ddeb76f315210d4f7c Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Sat, 24 Aug 2019 11:44:50 -0500 Subject: [PATCH] remote: use getattr instead of dict to get link methods --- dvc/remote/base.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/dvc/remote/base.py b/dvc/remote/base.py index 9a04d81a0..b40f20206 100644 --- a/dvc/remote/base.py +++ b/dvc/remote/base.py @@ -406,16 +406,9 @@ class RemoteBASE(object): @slow_link_guard def _try_links(self, from_info, to_info, link_types): - link_methods = { - "copy": self.copy, - "symlink": self.symlink, - "hardlink": self.hardlink, - "reflink": self.reflink, - } - i = len(link_types) while i > 0: - link_method = link_methods[link_types[0]] + link_method = getattr(self, link_types[0]) try: self._do_link(from_info, to_info, link_method) return