Kaydet (Commit) 13338a63 authored tarafından Aymeric Augustin's avatar Aymeric Augustin

[py3] Minor cleanup in django.utils.archive.

üst 67646dc2
...@@ -23,7 +23,6 @@ THE SOFTWARE. ...@@ -23,7 +23,6 @@ THE SOFTWARE.
""" """
import os import os
import shutil import shutil
import sys
import tarfile import tarfile
import zipfile import zipfile
...@@ -147,11 +146,11 @@ class TarArchive(BaseArchive): ...@@ -147,11 +146,11 @@ class TarArchive(BaseArchive):
else: else:
try: try:
extracted = self._archive.extractfile(member) extracted = self._archive.extractfile(member)
except (KeyError, AttributeError): except (KeyError, AttributeError) as exc:
# Some corrupt tar files seem to produce this # Some corrupt tar files seem to produce this
# (specifically bad symlinks) # (specifically bad symlinks)
print ("In the tar file %s the member %s is invalid: %s" % print("In the tar file %s the member %s is invalid: %s" %
(name, member.name, sys.exc_info()[1])) (name, member.name, exc))
else: else:
dirname = os.path.dirname(filename) dirname = os.path.dirname(filename)
if dirname and not os.path.exists(dirname): if dirname and not os.path.exists(dirname):
......
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