Commit 006917ec authored by Ezio Melotti's avatar Ezio Melotti

#14603: use a listcomp in ZipFile.namelist.

parent 578393b2
...@@ -836,10 +836,7 @@ class ZipFile: ...@@ -836,10 +836,7 @@ class ZipFile:
def namelist(self): def namelist(self):
"""Return a list of file names in the archive.""" """Return a list of file names in the archive."""
l = [] return [data.filename for data in self.filelist]
for data in self.filelist:
l.append(data.filename)
return l
def infolist(self): def infolist(self):
"""Return a list of class ZipInfo instances for files in the """Return a list of class ZipInfo instances for files in the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment