Skip to content

Commit 2ef3bf5

Browse files
committed
Fixing line length in a while condition and fixing the BPO func to meth
1 parent e851c01 commit 2ef3bf5

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
@@ -627,7 +627,8 @@ def from_file(cls, filename, arcname=None, *, strict_timestamps=True):
627627
if arcname is None:
628628
arcname = filename
629629
arcname = os.path.normpath(os.path.splitdrive(arcname)[1])
630-
while arcname[0] in (os.sep, os.altsep) and arcname[1] in (os.sep, os.altsep):
630+
while (arcname[0] in (os.sep, os.altsep) and
631+
arcname[1] in (os.sep, os.altsep)):
631632
arcname = arcname[1:]
632633
if arcname[0] in (os.sep, os.altsep) and os.sep not in arcname[1:]:
633634
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)