Skip to content

Commit bd659df

Browse files
committed
Fixing line length in a while condition and fixing the BPO func to meth
1 parent 3c96048 commit bd659df

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/zipfile/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,8 @@ def from_file(cls, filename, arcname=None, *, strict_timestamps=True):
644644
if arcname is None:
645645
arcname = filename
646646
arcname = os.path.normpath(os.path.splitdrive(arcname)[1])
647-
while arcname[0] in (os.sep, os.altsep) and arcname[1] in (os.sep, os.altsep):
647+
while (arcname[0] in (os.sep, os.altsep) and
648+
arcname[1] in (os.sep, os.altsep)):
648649
arcname = arcname[1:]
649650
if arcname[0] in (os.sep, os.altsep) and os.sep not in arcname[1:]:
650651
arcname = arcname[1:]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Fix unnecessary removing of a leading slash in :func:`zipfile.ZipInfo.from_file`
1+
Fix unnecessary removing of a leading slash in :meth:`zipfile.ZipInfo.from_file`
22
when member's archive name is in the form of `/directory/filename`.

0 commit comments

Comments
 (0)