Skip to content

Commit c4bd4a8

Browse files
barneygalepicnixz
andauthored
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 3db0e18 commit c4bd4a8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Lib/pathlib/_abc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class CopierBase:
100100
__slots__ = ('follow_symlinks', 'dirs_exist_ok', 'preserve_metadata')
101101

102102
def __init__(self, follow_symlinks=True, dirs_exist_ok=False,
103-
preserve_metadata=False):
103+
preserve_metadata=False):
104104
self.follow_symlinks = follow_symlinks
105105
self.dirs_exist_ok = dirs_exist_ok
106106
self.preserve_metadata = preserve_metadata
@@ -193,8 +193,7 @@ def copy_file(self, source, target, metadata_keys, dir_entry=None):
193193
# Raise a less confusing exception.
194194
raise FileNotFoundError(
195195
f'Directory does not exist: {target}') from e
196-
else:
197-
raise
196+
raise
198197
if metadata:
199198
target._write_metadata(metadata)
200199

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Speed up :meth:`pathlib.Path.copy` by making use of
1+
Speed up :meth:`Path.copy <pathlib.Path.copy>` by making use of
22
:meth:`~pathlib.Path.scandir` internally.

0 commit comments

Comments
 (0)