Commits

Stefan Schwarzer committed 092f9bd

Added comment on use of `isdir` instead of `try/except`.

Comments (0)

Files changed (1)

ftputil/ftp_sync.py

         if self._target.path.isfile(target_dir):
             raise ftp_error.SyncError("target dir '%s' is actually a file" %
                                       target_dir)
+        # Deliberately use an `isdir` test instead of `try/except`. The
+        #  latter approach might mask other errors we want to see, e. g.
+        #  insufficient permissions.
         if not self._target.path.isdir(target_dir):
             self._target.mkdir(target_dir)