diff --git a/ubelt/util_path.py b/ubelt/util_path.py index afe80e13..855628e5 100644 --- a/ubelt/util_path.py +++ b/ubelt/util_path.py @@ -1514,15 +1514,16 @@ def copy(self, dst, follow_file_symlinks=False, follow_dir_symlinks=False, copy_function = self._request_copy_function( follow_file_symlinks=follow_file_symlinks, follow_dir_symlinks=follow_dir_symlinks, meta=meta) + + if WIN32 and platform.python_implementation() == 'PyPy': + _patch_win32_stats_on_pypy() + if self.is_dir(): if sys.version_info[0:2] < (3, 8): # nocover copytree = _compat_copytree else: copytree = shutil.copytree - if WIN32 and platform.python_implementation() == 'PyPy': - _patch_win32_stats_on_pypy() - dst = copytree( self, dst, copy_function=copy_function, symlinks=not follow_dir_symlinks, dirs_exist_ok=overwrite)