From d1f14546aae0a6a749878e47d193ecafb5718e5e Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Mon, 6 Mar 2023 22:12:27 +0100 Subject: [PATCH] Fix tox --- ftpsync/resources.py | 1 - ftpsync/sftp_target.py | 5 ++++- ftpsync/synchronizers.py | 1 - ftpsync/targets.py | 1 - tests/test_develop.py | 1 - tests/test_sync_bidir.py | 1 - 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ftpsync/resources.py b/ftpsync/resources.py index d4d31a9..4cceab1 100644 --- a/ftpsync/resources.py +++ b/ftpsync/resources.py @@ -338,7 +338,6 @@ def classify(self, peer_dir_meta): # FileEntry # =============================================================================== class FileEntry(_Resource): - # 2 seconds difference is considered equal. # mtime stamp resolution depends on filesystem: FAT32. 2 seconds, NTFS ms, OSX. 1 sec. EPS_TIME = 2.01 diff --git a/ftpsync/sftp_target.py b/ftpsync/sftp_target.py index b7e304a..2205764 100644 --- a/ftpsync/sftp_target.py +++ b/ftpsync/sftp_target.py @@ -382,7 +382,10 @@ def rmdir(self, dir_name): # return self.sftp.rmdir(dir_name) return self._rmdir_impl(dir_name) - _paramiko_py3compat_u = paramiko.py3compat.u + try: + _paramiko_py3compat_u = paramiko.util.u + except AttributeError: + _paramiko_py3compat_u = paramiko.py3compat.u @staticmethod def _paramiko_py3compat_u_wrapper(s, encoding="utf8"): diff --git a/ftpsync/synchronizers.py b/ftpsync/synchronizers.py index 190e594..7786cf7 100644 --- a/ftpsync/synchronizers.py +++ b/ftpsync/synchronizers.py @@ -599,7 +599,6 @@ def _sync_dir(self): # 4. Perform (or schedule) resulting file operations for pair in entry_pair_list: - # print(pair) # Let synchronizer modify the default operation (e.g. apply `--force` option) diff --git a/ftpsync/targets.py b/ftpsync/targets.py index 0420c83..b190a30 100644 --- a/ftpsync/targets.py +++ b/ftpsync/targets.py @@ -418,7 +418,6 @@ def remove_sync_info(self, name): class FsTarget(_Target): - DEFAULT_BLOCKSIZE = 16 * 1024 # shutil.copyobj() uses 16k blocks by default def __init__(self, root_dir, extra_opts=None): diff --git a/tests/test_develop.py b/tests/test_develop.py index 01ce34a..b55f242 100644 --- a/tests/test_develop.py +++ b/tests/test_develop.py @@ -37,7 +37,6 @@ def tearDown(self): super().tearDown() def test_issue_20(self): - opts = {"verbose": 5} local_target = make_target(self.local_url) diff --git a/tests/test_sync_bidir.py b/tests/test_sync_bidir.py index 392861b..1ffbccb 100644 --- a/tests/test_sync_bidir.py +++ b/tests/test_sync_bidir.py @@ -156,7 +156,6 @@ def test_resolve_local(self): self.assert_test_folder_equal(get_test_folder("remote"), expect_local) def test_resolve_remote(self): - opts = {"resolve": "remote", "verbose": self.verbose} stats = self.do_run_suite(BiDirSynchronizer, opts)