summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-10-28 14:06:23 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-10-28 14:06:23 (GMT)
commit68f71a34f4a799276a50f4001fb0a0ebe2d46992 (patch)
tree5b7a409891bb7d4a1c1750b9f97b13a7d1e392e2 /Lib/tarfile.py
parent908ae24b066b04651701d5ee5e5d80cfb5d6b018 (diff)
downloadcpython-68f71a34f4a799276a50f4001fb0a0ebe2d46992.zip
cpython-68f71a34f4a799276a50f4001fb0a0ebe2d46992.tar.gz
cpython-68f71a34f4a799276a50f4001fb0a0ebe2d46992.tar.bz2
Simplify and remove few dependencies on 'errno', thanks to PEP 3151.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 39fe635..cf4e164 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -42,7 +42,6 @@ import sys
import os
import shutil
import stat
-import errno
import time
import struct
import copy
@@ -2281,9 +2280,8 @@ class TarFile(object):
# Use a safe mode for the directory, the real mode is set
# later in _extract_member().
os.mkdir(targetpath, 0o700)
- except EnvironmentError as e:
- if e.errno != errno.EEXIST:
- raise
+ except FileExistsError:
+ pass
def makefile(self, tarinfo, targetpath):
"""Make a file called targetpath.